Skip to content

Instantly share code, notes, and snippets.

@Aisuko
Last active July 29, 2019 02:41
Show Gist options
  • Save Aisuko/ab606028a9efd46df9c83c9a6e38a5d1 to your computer and use it in GitHub Desktop.
Save Aisuko/ab606028a9efd46df9c83c9a6e38a5d1 to your computer and use it in GitHub Desktop.
The nginx config for Rancher HA LoadBalance.
worker_processes 4;
worker_rlimit_nofile 40000;
events {
worker_connections 8192;
}
stream {
upstream rancher_servers_http {
least_conn;
server <IP_NODE_1>:80 max_fails=3 fail_timeout=5s;
server <IP_NODE_2>:80 max_fails=3 fail_timeout=5s;
server <IP_NODE_3>:80 max_fails=3 fail_timeout=5s;
}
server {
listen 80;
proxy_pass rancher_servers_http;
}
upstream rancher_servers_https {
least_conn;
server <IP_NODE_1>:443 max_fails=3 fail_timeout=5s;
server <IP_NODE_2>:443 max_fails=3 fail_timeout=5s;
server <IP_NODE_3>:443 max_fails=3 fail_timeout=5s;
}
server {
listen 443;
proxy_pass rancher_servers_https;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment