# Default page for all error codes?

**URL:** <https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992>\
**Category:** NGINX\
**Created:** [June 7, 2011, 8:56pm UTC](https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992 "2011-06-07T20:56:20Z")\
**Posts on this page:** 5\
**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:** [June 7, 2011, 8:56pm UTC](https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992/1 "2011-06-07T20:56:20Z")

</div>

hi,

is it possible to define one error page for all errors?

e.g.  
instead of having  
error\_page 404 = /myerrorpage.html

could i do something along the lines of  
error\_page \* = /myerrorpage.html

where \* would match all error codes?

cheers,

RJ

---

<div class="post-metadata">

**Author:** ![Ronald\_Johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/eb8c5e/32.png) [@Ronald\_Johnson](https://www.ruby-forum.com/u/Ronald_Johnson)\
**Post date:** [June 7, 2011, 9:42pm UTC](https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992/2 "2011-06-07T21:42:04Z")

</div>

On 7 Jun 2011 19h55 WEST, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> hi,
> 
> is it possible to define one error page for all errors?
> 
> e.g.  
> instead of having  
> error\_page 404 = /myerrorpage.html

> could i do something along the lines of  
> error\_page \* = /myerrorpage.html

I don’t thing you can do that. AFAIK you have to enumerate all HTTP  
error  
status codes you want to be handled.

error\_page 400 401 402 403 404 = /myerrorpage.html;

Add as many status codes as you need/want.

— appa

---

<div class="post-metadata">

**Author:** ![Ronald\_Johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/eb8c5e/32.png) [@Ronald\_Johnson](https://www.ruby-forum.com/u/Ronald_Johnson)\
**Post date:** [June 7, 2011, 9:58pm UTC](https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992/3 "2011-06-07T21:58:09Z")

</div>

thx, yeah, guess i will have to revert to that, would have been nifty  
just to do a \* and thats it.

cheers,

---

<div class="post-metadata">

**Author:** ![Ronald\_Johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/eb8c5e/32.png) [@Ronald\_Johnson](https://www.ruby-forum.com/u/Ronald_Johnson)\
**Post date:** [June 9, 2011, 8:43pm UTC](https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992/4 "2011-06-09T20:43:39Z")

</div>

hehe, true, but i think it is a common scenario that people want to  
display the right page, or some default page in case of any error,  
regardless of which.  
currently one has to make sure one doesnt forget any error code, in  
case the user will see the nginx default error page…

just my 0.02…

---

<div class="post-metadata">

**Author:** ![Ronald\_Johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/eb8c5e/32.png) [@Ronald\_Johnson](https://www.ruby-forum.com/u/Ronald_Johnson)\
**Post date:** [June 8, 2011, 12:12am UTC](https://www.ruby-forum.com/t/default-page-for-all-error-codes/207992/5 "2011-06-08T00:12:59Z")

</div>

Wouldn’t ‘\*’ match 200, 301, 302, etc… 🙂 Better to be precise and  
explicit.

Posted at Nginx Forum:

> **[Re: default page for all error codes?](https://forum.nginx.org/read.php?2,204774,204835#msg-204835)**
>
> hi, is it possible to define one error page for all errors? e.g. instead of having error\_page 404 = /myerrorpage.html could i do something along the lines of error\_page \* = /myerrorpage.html where \* would match all error codes?
