21 lines
619 B
Nginx Configuration File
21 lines
619 B
Nginx Configuration File
upstream api_backend {
|
|
zone api_backend 64k;
|
|
resolver 127.0.0.11 valid=2s ipv6=off;
|
|
server api1:8080 resolve max_fails=1 fail_timeout=2s;
|
|
server api2:8080 resolve max_fails=1 fail_timeout=2s;
|
|
keepalive 32;
|
|
}
|
|
|
|
server {
|
|
listen 8080;
|
|
location / {
|
|
proxy_pass http://api_backend;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_next_upstream error timeout http_502 http_503 http_504;
|
|
}
|
|
}
|