forked from mtusi2026/mtusi2026lab3
Исправить замечания ревью: ACL при повторе, повтор POST в nginx, активная проверка готовности
This commit is contained in:
+18
-13
@@ -9,8 +9,7 @@ http {
|
||||
|
||||
upstream api {
|
||||
zone api 64k;
|
||||
server api-1:8080 resolve max_fails=3 fail_timeout=10s;
|
||||
server api-2:8080 resolve max_fails=3 fail_timeout=10s;
|
||||
include /etc/nginx/upstream/servers.conf;
|
||||
keepalive 32;
|
||||
keepalive_timeout 4s;
|
||||
}
|
||||
@@ -24,19 +23,25 @@ http {
|
||||
server {
|
||||
listen 8080;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_connect_timeout 1s;
|
||||
proxy_read_timeout 10s;
|
||||
proxy_send_timeout 5s;
|
||||
proxy_next_upstream_tries 2;
|
||||
proxy_next_upstream_timeout 5s;
|
||||
|
||||
location ~ ^/api/v1/chats/[^/]+/messages$ {
|
||||
proxy_pass http://api;
|
||||
proxy_next_upstream error timeout http_502 http_503 non_idempotent;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://api;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_connect_timeout 1s;
|
||||
proxy_read_timeout 10s;
|
||||
proxy_send_timeout 5s;
|
||||
proxy_next_upstream error timeout http_502 http_503 non_idempotent;
|
||||
proxy_next_upstream_tries 2;
|
||||
proxy_next_upstream_timeout 5s;
|
||||
proxy_next_upstream error timeout http_502 http_503;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user