# Nginx cache and default error pages

**URL:** <https://www.ruby-forum.com/t/nginx-cache-and-default-error-pages/241063>\
**Category:** NGINX\
**Created:** [May 11, 2014, 9:15pm UTC](https://www.ruby-forum.com/t/nginx-cache-and-default-error-pages/241063 "2014-05-11T21:15:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 11, 2014, 9:15pm UTC](https://www.ruby-forum.com/t/nginx-cache-and-default-error-pages/241063/1 "2014-05-11T21:15:19Z")

</div>

Quick question:

## Are hardcoded default error pages being cached when \*\_cache directives specify their HTTP error code? Or does it only apply to pages specified with the error\_page directive? ​​

_B. R._

---

<div class="post-metadata">

**Author:** ![B.R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@B.R](https://www.ruby-forum.com/u/B.R)\
**Post date:** [May 12, 2014, 8:36pm UTC](https://www.ruby-forum.com/t/nginx-cache-and-default-error-pages/241063/2 "2014-05-12T20:36:40Z")

</div>

Hello!

On Sun, May 11, 2014 at 09:13:38PM +0200, B.R. wrote:

> Quick question:
> 
> Are hardcoded default error pages being cached when \*\_cache directives  
> specify their HTTP error code? Or does it only apply to pages specified  
> with the error\_page directive?

By default, nginx will cache pages as returned by an upstream  
server, regardless of status codes.

If you use proxy\_intercept\_errors to overwrite error pages  
returned by the upstream, this applies to error codes with  
corresponding error\_page set only.

–  
Maxim D.

> **[nginx](http://nginx.org/)**
