-
Notifications
You must be signed in to change notification settings - Fork 30
NGINX Load Balance Setup
Rainer Simon edited this page Jan 23, 2017
·
5 revisions
For load balancing, configure an upstream module and reference it in the server configuration block, like so:
upstream recogito {
server 127.0.0.1:9003;
server 127.0.0.1:9004;
server 127.0.0.1:9005;
}
server {
location / {
proxy_pass http://recogito;
}
}
A more concrete example is below:
http {
upstream recogito {
ip_hash;
zone recogito 64k;
server 127.0.0.1:8000 max_fails=3 fail_timeout=15s;
server 127.0.0.1:8001 max_fails=3 fail_timeout=15s;
server 127.0.0.1:8002 max_fails=3 fail_timeout=15s;
sticky cookie recogcookie expires=1h;
queue 100 timeout=70;
}
server {
listen 80;
server_name default_server;
location / {
proxy_pass http://recogito;
health_check interval=10 fails=3 passes=2;
}
}
}
More info at: