forked from mtusi2026/mtusi2026lab3
grade4
This commit is contained in:
+11
-2
@@ -2,8 +2,8 @@ events { worker_connections 1024; }
|
||||
|
||||
http {
|
||||
upstream messenger_api {
|
||||
server api-1:8080;
|
||||
server api-2:8080;
|
||||
server api-1:8080 max_fails=1 fail_timeout=5s;
|
||||
server api-2:8080 max_fails=1 fail_timeout=5s;
|
||||
}
|
||||
|
||||
server {
|
||||
@@ -11,6 +11,15 @@ http {
|
||||
|
||||
location / {
|
||||
proxy_pass http://messenger_api;
|
||||
|
||||
proxy_connect_timeout 2s;
|
||||
proxy_send_timeout 5s;
|
||||
proxy_read_timeout 5s;
|
||||
|
||||
proxy_next_upstream error timeout http_502 http_503 http_504;
|
||||
proxy_next_upstream_tries 2;
|
||||
proxy_next_upstream_timeout 5s;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user