Welcome! Log In Create A New Profile

Advanced

error pages: bug or feature?

Piotr Sikora
July 18, 2009 08:28PM
Hello,
I noticed that config:

server {
location / {
// doesn't exist, will result in 502
proxy_pass http://localhost:11111;
error_page 502 @fetch;
}
location @fetch {
proxy_pass http://localhost:8080;
}
}

will result in response from http://localhost:8080 and "502 Bad Gateway"
status,
while config:

server {
location / {
// doesn't exist, will result in 502
proxy_pass http://localhost:11111;
error_page 502 = @fetch;
}
location @fetch {
proxy_pass http://localhost:8080;
}
}

will result in response from http://localhost:8080 and "200 OK" status.

The cause of this difference is '=' sign and the fact that
ngx_http_core_error_page function sets overwrite to -1 in first case, and
overwrite to 0 in second case.

Is passing original response status with headers and body from "error page"
some kind of feature or is it a bug and error pages without '=' shouldn't be
allowed at all?

Best regards,
Piotr Sikora < piotr.sikora@frickle.com >
Subject Author Posted

error pages: bug or feature?

Piotr Sikora July 18, 2009 08:28PM

Re: error pages: bug or feature?

Igor Sysoev July 19, 2009 01:55AM

Re: error pages: bug or feature?

Piotr Sikora July 19, 2009 02:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
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