Lab 3: solution for grade 3 - BPI2304 Vardanyan

This commit is contained in:
garik
2026-11-16 22:10:49 +03:00
parent 0ab3a341aa
commit 0b6edebfc0
17 changed files with 937 additions and 169 deletions
+30
View File
@@ -0,0 +1,30 @@
# Nginx >= 1.27.3 supports dynamic DNS re-resolution for upstream servers.
events { worker_connections 1024; }
http {
access_log /dev/stdout;
error_log /dev/stderr warn;
upstream messenger_api {
zone messenger_api 64k;
resolver 127.0.0.11 valid=1s ipv6=off;
server api1:8080 resolve max_fails=1 fail_timeout=2s;
server api2:8080 resolve max_fails=1 fail_timeout=2s;
}
server {
listen 8080;
server_name _;
client_max_body_size 1m;
location / {
proxy_pass http://messenger_api;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Request-Id $request_id;
proxy_connect_timeout 1s;
proxy_send_timeout 5s;
proxy_read_timeout 5s;
proxy_next_upstream error timeout http_502 http_503 http_504;
proxy_next_upstream_tries 2;
}
}
}