# Nginx + Passenger error\_page setup

**URL:** <https://www.ruby-forum.com/t/nginx-passenger-error-page-setup/210827>\
**Category:** NGINX\
**Created:** [August 18, 2011, 11:50am UTC](https://www.ruby-forum.com/t/nginx-passenger-error-page-setup/210827 "2011-08-18T11:50:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [August 18, 2011, 11:50am UTC](https://www.ruby-forum.com/t/nginx-passenger-error-page-setup/210827/1 "2011-08-18T11:50:13Z")

</div>

Im running a Merb project base on Nginx + Passenger, when the  
application got error, it will raise 502 Bad Gateway page. so we want to  
customize the error page. so we add these to the configuration file:

http{  
server{  
…  
error\_page 500 502 503 504 /500.html;  
location = /500.html {  
root /home/some\_dir/;  
}  
…  
}  
]

but it couldn’t work, I google a lot, but couldn’t get correct solution,  
am I miss sth?

thanks

Posted at Nginx Forum:

> **[Nginx + Passenger error\_page setup](https://forum.nginx.org/read.php?2,213979,213979#msg-213979)**
>
> Im running a Merb project base on Nginx + Passenger, when the application got error, it will raise 502 Bad Gateway page. so we want to customize the error page. so we add these to the configuration file: http{ server{ .... error\_page 500 502 503 5

---

<div class="post-metadata">

**Author:** ![ysorigin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b5e925/32.png) [@ysorigin](https://www.ruby-forum.com/u/ysorigin)\
**Post date:** [August 18, 2011, 1:25pm UTC](https://www.ruby-forum.com/t/nginx-passenger-error-page-setup/210827/2 "2011-08-18T13:25:58Z")

</div>

Hello!

On Thu, Aug 18, 2011 at 05:49:40AM -0400, ysorigin wrote:

> ```
> }
> ....
> 
> ```
> 
> }  
> ]
> 
> but it couldn’t work, I google a lot, but couldn’t get correct solution,  
> am I miss sth?

You need something like proxy\_intercept\_errors, see

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

No idea if passenger has one, but you may try something like  
“passenger\_intercept\_errors”.

Maxim D.
