Welcome! Log In Create A New Profile

Advanced

Two jumps using error_page directive

Kamil Gorlo
January 12, 2010 08:24AM
Hi all,

I have problem using error_page directive, here is main part of
problematic config:

>>>>>
upstream test {
server localhost:2009;
}

upstream test2 {
server localhost:2010;
}

server {
listen 80;

location / {
proxy_pass http://test;
error_page 404 500 502 = @fail;
}

location @fail {
proxy_pass http://test2;
error_page 404 500 502 /50x.html;
}

location = /50x.html {
internal;
root /var/www/nginx-default;
}
}
<<<<<

This is of course minimal config with the same problem I have in more
complicated scenario.

Here is my case: assume both test and test2 upstreams are dead. I want
to see nice static page with error explanation (/50x.html) but this is
not working. Instead, I see standard nginx 502 error. So only first
error_page directive caused jump to @fail location but then 502 didn't
cause second jump to /50x.html. Why?

I hope everything is clear enough :)

Cheers,

--
Kamil

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Two jumps using error_page directive

Kamil Gorlo January 12, 2010 08:24AM

Re: Two jumps using error_page directive

Maxim Dounin January 12, 2010 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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