Вот моя текущая конфигурация:
Код: Выделить всё
server {
listen 81;
server_name *.host.com;
port_in_redirect off;
access_log /var/log/nginx/_access.log;
error_log /var/log/nginx/_error.log;
root /var/www/html/web;
index index.php index.html index.htm;
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /app.php/$1 last;
}
# PHP-FPM configuration
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param HTTP_PROXY "";
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... pplication
Мобильная версия