Reactive-Resume/tools/nginx/app_nginx.conf
2023-11-05 12:31:42 +01:00

36 lines
856 B
Plaintext

events {
worker_connections 512;
}
http {
upstream app {
least_conn;
# List all of your `app` instances here to balance the load between them
server app_one:3000;
server app_two:3000;
}
server {
listen 80;
# This instructs nginx to forward the request to the next available `app` instance
# in case the current one throws an error or times out
proxy_next_upstream error timeout http_500 http_503 http_429 non_idempotent;
location / {
proxy_pass http://app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_connect_timeout 1000ms;
proxy_send_timeout 1000ms;
proxy_read_timeout 1000ms;
send_timeout 1000ms;
}
}
}