Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using Nginx on Ubuntu to host a Wordpress site and everything is working great except certain file types return the Nginx 404 rather than the Wordpress template 404.

For example: shows the Nginx 404 page.

While shows the template 404 page.

What am I missing in my configuration of Nginx?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I received a response with code that fixed the issue from

Add this code to the nginx site configuration for the domain has the issue with not all 404 requests being handled by Wordpress:

if (!-e $request_filename) {
        rewrite ^/(.+)$ /index.php?q=$1 last;
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.