# Nginx not picking up error\_page

**URL:** <https://www.ruby-forum.com/t/nginx-not-picking-up-error-page/164194>\
**Category:** NGINX\
**Created:** [March 29, 2009, 8:37pm UTC](https://www.ruby-forum.com/t/nginx-not-picking-up-error-page/164194 "2009-03-29T20:37:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71e660/32.png) [@Guy\_N](https://www.ruby-forum.com/u/Guy_N)\
**Post date:** [March 29, 2009, 8:37pm UTC](https://www.ruby-forum.com/t/nginx-not-picking-up-error-page/164194/1 "2009-03-29T20:37:21Z")

</div>

Hi,

I have an nginx setup to serve rails applications. But for some reason  
it’s not picking up the error\_page 400 404 /40x.html.

Here is part of the config file:

This is inside my location / {} config part

error\_page 500 502 503 504 /50x.html;  
error\_page 404 400 403 /40x.html;

Here is the access log entry. Nginx is getting a 500 but just returning  
it as is (it’s the exception description in rails). But I want it to go  
to the nicer 50x.html

72.211.211.12 [guy.test.com](http://guy.test.com) - [29/Mar/2009:18:17:46 +0000] GET /testpage  
HTTP/1.1 “500” 21799 “-” “Mozilla/5.0 (X11; U; Linux x86\_64; en-US;  
rv:1.9.0.7) Gecko/2009030503 Fedora/3.0.7-1.fc10 Firefox/3.0.7” “-”

The error log shown no error, btw.

Bye,

Guy.

---

<div class="post-metadata">

**Author:** ![Guy\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71e660/32.png) [@Guy\_N](https://www.ruby-forum.com/u/Guy_N)\
**Post date:** [March 30, 2009, 2:10am UTC](https://www.ruby-forum.com/t/nginx-not-picking-up-error-page/164194/2 "2009-03-30T02:10:10Z")

</div>

Hello!

On Sun, Mar 29, 2009 at 11:28:35AM -0700, Guy N. wrote:

> error\_page 404 400 403 /40x.html;
> 
> Here is the access log entry. Nginx is getting a 500 but just returning  
> it as is (it’s the exception description in rails). But I want it to go  
> to the nicer 50x.html

By default nginx only uses error\_page’s for errors it generates  
itself. If you want it to intercept errors returned by backends -  
use proxy\_intercept\_errors/fastcgi\_intercept\_errors as  
appropriate.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Guy\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71e660/32.png) [@Guy\_N](https://www.ruby-forum.com/u/Guy_N)\
**Post date:** [March 30, 2009, 2:41am UTC](https://www.ruby-forum.com/t/nginx-not-picking-up-error-page/164194/3 "2009-03-30T02:41:45Z")

</div>

Hi Maxim,

Perfect! Thanks a lot.

Bye,

Guy.
