I've already read that : how to remove location block from $uri in nginx configuration?
but is there a way to strip the location blocks's prefix from the $fastcgi_script_name without using regex ?
for example :
location /foo/ {
access_log /var/log/nginx/access-truc.log FOO;
alias /srv/http/php;
fastcgi_pass fpm;
fastcgi_index index.php;
include fastcgi.conf;
}
(note : FOO is a log format to display $fastcgi_script_name)
fastcgi.conf has this line :
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
And I want $fastcgi_script_name
set to only bar.php
instead of foo/bar.php
for the url http://example.com/foo/bar.php