32 lines
952 B
Plaintext
32 lines
952 B
Plaintext
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
# Used only by scripts/research-scale.py with compose.scale.yaml.
|
|
upstream api {
|
|
server api-1:8080 max_fails=3 fail_timeout=10s;
|
|
server api-2:8080 max_fails=3 fail_timeout=10s;
|
|
server api-3:8080 max_fails=3 fail_timeout=10s;
|
|
server api-4:8080 max_fails=3 fail_timeout=10s;
|
|
}
|
|
|
|
server {
|
|
listen 8080;
|
|
server_name _;
|
|
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;
|
|
proxy_next_upstream_tries 4;
|
|
location / { proxy_pass http://api; }
|
|
}
|
|
}
|