30 lines
805 B
Nginx Configuration File
30 lines
805 B
Nginx Configuration File
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
upstream api_backend {
|
|
server api:8080 max_fails=1 fail_timeout=3s;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
keepalive_timeout 0;
|
|
|
|
location / {
|
|
proxy_pass http://api_backend;
|
|
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_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
|
|
proxy_connect_timeout 1s;
|
|
proxy_read_timeout 2s;
|
|
|
|
# Пробуем следующую реплику при любой ошибке
|
|
proxy_next_upstream error timeout http_502 http_503 http_504;
|
|
}
|
|
}
|
|
} |