Avoiding Arbitrary Code Execution with nginx and php-fastcgi
nealpoole.com
nealpoole.com
location ~ ^/index\.php {
proxy_pass http://localhost:8080;
}
Everything else in the web root is static files and can be served directly. The rest of the application uses an URL routing scheme based on PATH_INFO location = /index.php {
fastcgi_pass 127.0.0.1:9000;
}I decided to switch to Nginx for the fabled performance benefits and relatively simple configuration. But this now makes me wonder what other gotchas there are in store for me... I have a long history with Apache, maybe I should just stick with it after all...
I was planning to move my server from Apache to Nginx soon. I suppose it's as a good time as ever to learn any gotchas.
UPDATE: Here's the thread on this issue right from NGINX.org http://forum.nginx.org/read.php?2,88845,page=3
location = /index.php { proxy_pass http://localhost:8080; }
It only runs exactly index.php in the root.