If I request /maintenance.php, it gets executed.
If I request /foo (and maintenance.php exists), maintenance.php gets downloaded.
What am I missing ?
location / {
try_files $uri /maintenance.php @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app_prod.php/$1 last;
}
location ~ ^/(app_prod|maintenance)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
NB: It seems like
location ~ ^/(app_prod|maintenance)\.php(/|$)
is not triggered after
try_files $uri /maintenance.php @rewriteapp;