Ikke is correct, use try_files as follows:
location / { try_files $uri $uri/ /index.php; }
But your PHP fastcgi location is unsafe. See this article to learn more about this.
For your setup you need to have something like this:
location ~ \.php$ { try_files $uri /index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; include /etc/nginx/fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9001; }
Note that you must set the local fastcgi_param after enabling the global fastcgi_params configuration.
source share