Files
back_end_oudelaa/deploy/nginx.scale.conf
boutmoun123 da73d20ca9
API Gateway CI / Build, lint, and test (push) Failing after 8m51s
API Gateway CI / Build API Gateway image (push) Skipped
API Gateway CI / Build Notification Service image (push) Skipped
Optimize backend performance and deployment
2026-11-14 14:43:46 +03:00

39 lines
1.2 KiB
Plaintext

worker_processes auto;
events { worker_connections 2048; }
http {
resolver 127.0.0.11 valid=10s ipv6=off;
map $http_upgrade $connection_upgrade {
default upgrade;
'' '';
}
upstream api {
zone api 64k;
# Keep Socket.IO HTTP polling on the same replica. Redis shares room events.
ip_hash;
server api-a:4000 resolve max_fails=3 fail_timeout=10s;
server api-b:4000 resolve max_fails=3 fail_timeout=10s;
server api-c:4000 resolve max_fails=3 fail_timeout=10s;
keepalive 32;
}
server {
listen 8080;
client_max_body_size 128m;
location / {
proxy_pass http://api;
proxy_http_version 1.1;
proxy_set_header Host $host;
# Replace client-supplied forwarding headers at this trusted boundary.
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_connect_timeout 3s;
proxy_read_timeout 240s;
proxy_send_timeout 240s;
proxy_next_upstream error timeout http_502 http_503 http_504;
# Never enable non_idempotent retries: writes must not be replayed.
}
}
}