Inklings: a tumblelog

Issues with nginx and php-fpm on FreeBSD

I spent an age trying to fix this, but the log output of neither nginx nor php-fpm gave any indication as to why I got nothing except empty responses when trying to access .php files.

Eventually, I stumbled across this post on ServerFault, which lead me to try adding this to the location section:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

And bingo! It starts working. I can’t fathom why php-fpm didn’t either respond with an error, either in the log or as a response, or couldn’t have fathomed it from the DOCUMENT_ROOT and SCRIPT_NAME headers. That’s some mighty good design! </sarcasm>