WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using this page (http://wiki.nginx.org/WordPress) to setup my WordPress on a nginx/php-fpm server.

Everything is okay, except the 404 page

  1. When I request www.example.com/foo, it send me the default nginx 404 not found page
  2. I have already set the following, but no luck..


fastcgi_intercept_errors on;
error_page   404  /index.php?error=404;

I have tried to add some code (e.g. die("wordpress");) in a plugin when I request this page, and clearly that the request is handled by wordpress already, but it just can't use the 404.php in the default template.

Anyone can help?

share|improve this question
I'm commenting here only to thank you for linking to that Nginx wiki page that was modified by a person who promoted his site and his plugin all over that page. Fixed it. Thanks again, Yoga! – Pothi Nov 7 '12 at 11:08

Remove the 'fastcgi_intercept_errors' argument from you configuration. It's unnecessary since 'error_page' declares 404 errors, which should be handled by index.php, which will trigger PHP-FPM to handle it, and WordPress to present your theme's 404 page.

It seems counter-intuitive, but 'fastcgi_intercept_errors' is actually causing PHP not to handle the error page.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.