server {
root ...;
index index.php;
location = /index.php {
# do what you want with it
fastcgi_pass /path/to/fpm/sock/file;
}
location / {
# not matching /index.php here, so passing over to upstream
proxy_pass http://your.upstream/;
...
}
}