лаба на 3

This commit is contained in:
2026-10-15 00:18:02 +03:00
parent 0ab3a341aa
commit d3bb55ba09
29 changed files with 2397 additions and 18 deletions
+31
View File
@@ -0,0 +1,31 @@
events {
worker_connections 1024;
}
http {
upstream api_backend {
server api-1:8080 max_fails=1 fail_timeout=5s;
server api-2:8080 max_fails=1 fail_timeout=5s;
}
server {
listen 8080;
location / {
proxy_pass http://api_backend;
proxy_http_version 1.1;
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_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 2s;
proxy_read_timeout 10s;
proxy_send_timeout 10s;
proxy_next_upstream error timeout http_502 http_503 http_504;
proxy_next_upstream_tries 2;
}
}
}