200 response on Nginx 404 error page

Anth0ny picture Anth0ny · Aug 14, 2013 · Viewed 7.2k times · Source

My server uses a custom 404 page. Is't possible to get 404 server response on a direct request of 404 page? Now: URL: http://mydomain.xxx/404.php HTTP/1.1 200 OK Server: nginx

Answer

Mohammad AbuShady picture Mohammad AbuShady · Aug 14, 2013

you can simply do

error_page 404 =200 /404.php;