feat: configure nginx load balancer and compose scaling
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
worker_processes 1;
|
||||
|
||||
events { worker_connections 1024; }
|
||||
|
||||
http {
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
upstream api_backend {
|
||||
server api:8080 max_fails=3 fail_timeout=5s;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
proxy_pass http://api_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_connect_timeout 2s;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user