Default page for all error codes?

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

On 7 Jun 2011 19h55 WEST, [email protected] 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

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

cheers,

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…

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

Posted at Nginx Forum: