Nginx+PHP (on fastCGI) works great for me. When I enter a path to a PHP file which doesn\'t exist, instead of getting the default 404 error page (which comes for any invalid
Be careful with the syntax! Great Turtle used them interchangeably, but:
error_page 404 = /404.html;
Will return the 404.html page with a status code of 200 (because = has relayed that to this page)
error_page 404 /404.html;
Will return the 404.html page with a (the original) 404 error code.
https://serverfault.com/questions/295789/nginx-return-correct-headers-with-custom-error-documents