Here’s the secret!

4 06 2008

(moar nginx post. And with totally unrelated pics)

If you find “No file specified” error message disturbing (as I did), here’s the configuration to remove it!
location ~ \.php$ {
if (!-e /var/www/htdocs/genshiken.unit.itb.ac.id$fastcgi_script_name) {
return 404;
break;
}

include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:55555;
fastcgi_index index.php;
fastcgi_param  SCRIPT_FILENAME    /var/www/htdocs/genshiken.unit.itb.ac.id$fastcgi_script_name;
}

Basically the key is using full pathname to check the file availability. Using normal if (-f $request_filename) won’t work.