forked from mtusi2026/mtusi2026lab4
23 lines
636 B
Nginx Configuration File
23 lines
636 B
Nginx Configuration File
events {}
|
|
http {
|
|
upstream api_replicas {
|
|
server api1:8080 max_fails=2 fail_timeout=5s;
|
|
server api2:8080 max_fails=2 fail_timeout=5s;
|
|
}
|
|
server {
|
|
listen 8080;
|
|
client_max_body_size 11m;
|
|
location / {
|
|
proxy_pass http://api_replicas;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
proxy_connect_timeout 500ms;
|
|
proxy_read_timeout 30s;
|
|
proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
|
proxy_next_upstream_tries 2;
|
|
}
|
|
}
|
|
}
|