Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
August 10, 2020 08:48AM
Hello!

On Sun, Aug 09, 2020 at 10:45:14AM -0400, stmx38 wrote:

> Maxim, thank you for reply!
>
> Some additional question here:
> 1. If we will remove 'timeout' will Nginx send traffic to the next upstream
> on 502 error?

The "timeout" parameter corresponds to 504 returned to clients and
in $upstream_status, the "error" one corresponds to 502 returned to
clients and in $upstream_status. Accordingly, removing "timeout"
won't affect anything related to 502. It will, however, stop nginx
from trying next upstream servers on timeouts, also known as 504.

> 2. More general question related the the Q.1. When Nginx interpret reply as
> 502 - on timeout, if yes - on which one? We have a lot of timeouts defined
> in the main config:
> ----
> client_header_timeout 30s;
> client_body_timeout 30s;
> send_timeout 65s;
>
> proxy_connect_timeout 5s;
> proxy_send_timeout 65s;
> proxy_read_timeout 65s;
> ----

Quoting the docs (http://nginx.org/r/proxy_next_upstream):

timeout
a timeout has occurred while establishing a connection with the
server, passing a request to it, or reading the response header;

That is, this implies timeouts when working with upstream server.
Relevant configuration directives are proxy_connect_timeout,
proxy_send_timeout, and proxy_read_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: 187
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