nginx: try_files not finding static files, falling back to PHP
- by Wells Oliver
Relevant configuration:
location /myapp {
root /home/me/myapp/www;
try_files $uri $uri/ /myapp/index.php?url=$uri&$args;
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
}
I absolutely have a file foo.html in /home/me/myapp/www but when I browse to /myapp/foo.html it is handled by PHP, the final fallback in the try_files list.
Why is this happening?