fix(nginx): retry message POST on another replica after 500

This commit is contained in:
kk10
2026-10-20 22:52:36 +03:00
parent ff18997111
commit 85708b3417
2 changed files with 14 additions and 4 deletions
+11 -1
View File
@@ -8,13 +8,23 @@ http {
server {
listen 8080;
location ~ ^/api/v1/chats/[^/]+/messages$ {
set $backend http://api:8080;
proxy_pass $backend;
proxy_connect_timeout 1s;
proxy_read_timeout 6s;
proxy_next_upstream error timeout http_500 http_502 http_503 non_idempotent;
proxy_next_upstream_tries 2;
}
location / {
set $backend http://api:8080;
proxy_pass $backend;
proxy_connect_timeout 1s;
proxy_read_timeout 6s;
proxy_next_upstream error timeout http_502 http_503;
proxy_next_upstream error timeout http_500 http_502 http_503;
proxy_next_upstream_tries 2;
}
}