This is how I route EVERYTHING to index.php, including sub-directory requests, HTTP args, ect.
location / {
try_files $uri $uri/ /index.php?$args; #if doesn't exist, send it to index.php
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
# By all means use a different server for the fcgi processes if you need to
fastcgi_pass 127.0.0.1:9000;
}
So for example, these get sent to index.php:
http://foo.bar/something/
http://foo.bar/something/?something=1
While these go directly to files
http://foo.bar/someotherphp.php
http://foo.bar/assets/someimg.jpg