Welcome! Log In Create A New Profile

Advanced

$upstream_status may show 502 even if upstream replied with 503

August 17, 2015 05:39PM
My nginx.conf:
http {

upstream test {
server 127.0.0.1:8081 max_fails=0;
server 127.0.0.1:8082 max_fails=0;
}

server {
listen 8080;
location / {
proxy_pass http://test;
}
proxy_next_upstream http_503;
proxy_intercept_errors on;
}

log_format main '$upstream_status';
...
}

If my upstream servers are on and always reply with 503 I expect to find in log
503, 503
Instead I find
502, 503
Is it ok that first upstream status is 502 instead of 503?

Can I somehow configure nginx to show 503?
Because in case of more complicated
proxy_next_upstream error http_503
it is more useful to see fair upstream status to distinguish between error and http_503.
Subject Author Posted

$upstream_status may show 502 even if upstream replied with 503

Anton Ivanov August 17, 2015 05:39PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 65
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 214 on March 20, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready