Welcome! Log In Create A New Profile

Advanced

Reset "error_page" to nginx default

Posted by TitusX 
Reset "error_page" to nginx default
November 08, 2011 04:28AM
Hi there,


We are using a very complex setting of nginx for offloading ssl and dispatching urls to different backends.
In our global config we override the error pages. This is okay for all backends bur one - a SOAP service.
This service needs the unchanged errors.

The question is:
Is there a way to set the "error_page" back to trhe internal error pages.

http {
...
error_page 500 501 502 503 504 /50x.html;
...
server {
...
location /soap-service/ {
# how to reset error_page 500 ??????;
proxy_pass http://soap-failover-backend;
}
}
}

Thanx a lot,
T.
Re: Reset "error_page" to nginx default
November 09, 2011 06:14AM
Thanx for trying to solve it ... I got a solution.

1. Nginx works straight forward, but it have default values for "error_page".
Default for the 40x errors are not "none" (like in the docu) it's of course
an internal error page like

error_page 401 403 404 /40x.html
location /40x.html { internal; }

Default for the 50x errors are "none" - means do nothing, pass it through.

2. Like the "access_log" command, it is possible to use more than on.
So the usage of "error_page" in eg. "server" not only overrides one setting in "http",
it wipes it completly out. Everything is set to "none".
So you only have to use one dummy "error_page" command or somthing like (1.)

T.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready