# Showing native 404 page and not the custom 404 in some circumstances

**URL:** <https://www.ruby-forum.com/t/showing-native-404-page-and-not-the-custom-404-in-some-circumstances/217418>\
**Category:** NGINX\
**Created:** [March 1, 2012, 7:25am UTC](https://www.ruby-forum.com/t/showing-native-404-page-and-not-the-custom-404-in-some-circumstances/217418 "2012-03-01T07:25:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 1, 2012, 7:25am UTC](https://www.ruby-forum.com/t/showing-native-404-page-and-not-the-custom-404-in-some-circumstances/217418/1 "2012-03-01T07:25:19Z")

</div>

I have a 404 page defined as follows. If I purposefully hit a non valid  
page I see the custom 404 page. But sometimes due to rate limiting and  
probably busy CPU I see the default nginx 404 page.

I can’t narrow this down to the precise reason, but I keep seeing this  
every now and then. I don’t run a very powerful VM

How do I show the custom 404 always?

```
    error_page 404 = @errorpages;

    location @errorpages {

                root /var/www/prod/cucumbertown/templates/;

                internal;

                proxy_pass http://localhost:82;

                proxy_set_header Host $host;

                proxy_set_header X-Real-IP $remote_addr;

                proxy_set_header Accept-Encoding "";

                proxy_ignore_headers Set-Cookie;

                proxy_ignore_headers Cache-Control;

                proxy_ignore_headers Expires;

                proxy_ignore_headers X-Accel-Expires;

                add_header X-Cache-Status $upstream_cache_status;

                proxy_cache jscss;

                proxy_cache_key $request_uri;

        proxy_cache_use_stale updating;

    }

```

-Quintin
