I have this set up in an nginx site config, which is working perfectly to redirect all .html
requests through to /index.php
. However it doesn't rewrite test.php
to /index.php
and instead throws a 404 error.
Can anyone shed any light please? Here is my site config:
server {
listen 80 default_server;
location / {
root /srv/www/htdocs;
index index.php;
try_files $uri $uri/ /index.php;
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param HTTPS on; # <-- add this line
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
}
}
Any help appreciated - I'm tearing my hair out!