$upstream_status may show 502 even if upstream replied with 503

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.

Posted at Nginx Forum: