Welcome! Log In Create A New Profile

Advanced

Re: Why Nginx send traffic to the next upstream on 504 error

Maxim Dounin
August 09, 2020 08:30AM
Hello!

On Sat, Aug 08, 2020 at 12:55:47PM -0400, stmx38 wrote:

> We have an Nginx where we configured
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream
> in Nginx main config file at http level.
>
> We don't want to send traffic to the next upstream on 504:
> ----
> proxy_next_upstream error timeout http_502 http_503 non_idempotent;
> ----
>
> At vhost level we don't redefine this directive. But periodically we see the
> following in Nginx logs:
> ----
> 141.101.69.85 - 192.168.1.10 - 59.489 - [08/Aug/2020:11:10:41.098 +0000] -
> POST - /api/ - HTTP/1.1 - 499 - - 0 - 2054 - "Java/1.8.0_242" - api-worker
> - "192.168.1.11:8080, 192.168.1.12:8080" - "504, -" - "0.000, 0.000" -
> "31.000, 28.489"
> ----
>
> api-worker - "192.168.1.11:8080, 192.168.1.12:8080" - "504, -"
>
> From the logs we see that Nginx received 504 status from the first upstream
> and then for some reason send traffic to the next one, despite the fact that
> it should not do it on 504 http status.

The "504" status in $uptream_status is used to indicate timeouts,
much like 502 to indicate errors. These are status codes nginx
itself generates due to observed error conditions. And your
"proxy_next_upstream" includes "timeout".

[...]

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Why Nginx send traffic to the next upstream on 504 error

stmx38 August 08, 2020 12:55PM

Re: Why Nginx send traffic to the next upstream on 504 error

Maxim Dounin August 09, 2020 08:30AM

Re: Why Nginx send traffic to the next upstream on 504 error

stmx38 August 09, 2020 10:45AM

Re: Why Nginx send traffic to the next upstream on 504 error

Maxim Dounin August 10, 2020 08:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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