fast failover
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
upstream phoenix_backend {
|
||||
# Hash based on WebSocket handshake key for sticky sessions
|
||||
# Note: Each new connection gets a new key, so reconnections may route differently
|
||||
hash $http_sec_websocket_key consistent;
|
||||
|
||||
server phoenix1:4000 max_fails=1 fail_timeout=10s;
|
||||
@@ -22,6 +20,11 @@ server {
|
||||
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_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
||||
proxy_next_upstream_tries 1;
|
||||
proxy_connect_timeout 1s;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
|
||||
location /api {
|
||||
@@ -31,6 +34,11 @@ server {
|
||||
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_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
||||
proxy_next_upstream_tries 3;
|
||||
proxy_connect_timeout 5s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
location /health {
|
||||
|
||||
Reference in New Issue
Block a user