Nginx returns a 404 when I query for an URL with a "path info" appended after the script name, e.g. http://example.com/index.php/hello.
Here is my config:
server {
listen 80;
root @PROJECT_ROOT@/;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass unix:@PHP_FPM_SOCK@;
include fastcgi_params;
fastcgi_read_timeout 300s;
}
}
I don't get why \.php$
doesn't match that URL, and I've tried searching for similar problems but can't find anything useful.
\.php$
is forcing nginx to match only URLs ending with.php
. Why dont you a look on how popular frameworks arrange this setup like Symfony2? symfony.com/doc/current/cookbook/configuration/…