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? 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_tby stmx38 - Nginx Mailing List - English
Hello, 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 followingby stmx38 - Nginx Mailing List - English
Hello Francis, It seems that your solution working as expected and I have started to test it. Also, have some questions here: 1. "~*" to be "~^" The first one looks like Nginx regexp we can use for locations, but the second one not (^~): https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms 2. It seems thatby stmx38 - Nginx Mailing List - English
Hello, We have a case when we should permit different methods on the same location but different requests. For location /test we should permit only POST, for /test?doc we should permit only GET methods. Our config example: ---- location /test { error_page 403 =405 /custom-error; limit_except POST { deny all; } proxy_pass http://test/in; } ---- Maby stmx38 - Nginx Mailing List - English
Maxim, Different locations solved the issue. Thank you for the help!by stmx38 - Nginx Mailing List - English
Hello, We use Nginx map module to sent traffic to different upstreams based on the HTTP header: map $http_flow $flow_upstream { default "http://flow-dev"; prod "http://flow-prod"; test "http://flow-test"; dev "http://flow-dev"; } location / { proxy_read_timeout 5s; proxy_pass $flow_upstream; } Now, we want toby stmx38 - Nginx Mailing List - English
Francis, Basically, the issue was with the 'proxy_set_header' directives. In such cases, when we define at least one in the location, we should also define all the rests headers. From your reply, I understand that with the 'proxy_read_timeout/proxy_send_timeout' we should not have such situations. Thank you for your reply and explanation!by stmx38 - Nginx Mailing List - English
Hello, We recently made some order in our configuration to make it cleaner and readable. We have moved all reverse proxy related parameters on the HTTP level from the vhosts locations: ---- proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_read_by stmx38 - Nginx Mailing List - English
![]() |
![]() |
![]() |
![]() |
![]() |