Попробуйте следующее:
nginx.conf:
http {
...
map $uri $script_url {
~^(?<script_filename>.+\.php)(?<path_info>.+)$ $path_info;
~^(?<script_filename>.+\.php)$ $script_filename;
}
...
}
fastcgi_params:
#fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_php.conf:
include fastcgi_params;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_URL $script_url;
fastcgi_param SCRIPT_URI $scheme://$http_host$script_url;
# fastcgi_param SCRIPT_FILENAME $document_root$script_filename;
# fastcgi_param PATH_INFO $path_info;
# fastcgi_param PATH_TRANSLATED $document_root$path_info;
# fastcgi_param SCRIPT_NAME $script_url;
try_files $fastcgi_script_name =404;
В виртуальных хостах или локейшнах, где используется php, подгружайте fastcgi_php.conf (вместо fastcgi_params), пример:
location / {
index index.php index.html;
try_files $uri $uri/ /index.php$request_uri;
}
include fastcgi_php.conf;
location ~ ^.+\.php {
fastcgi_pass ....;
}
Андрей