Created
March 1, 2019 18:49
-
-
Save aric49/bd051097e41e477c362410e5b3413023 to your computer and use it in GitHub Desktop.
NGINX Reverse Proxy Load Balancer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Unabashedly stolen and modified from: https://rancher.com/docs/rancher/v2.x/en/installation/ha/create-nodes-lb/nginx/ | |
| worker_processes auto; | |
| worker_rlimit_nofile 40000; | |
| events { | |
| worker_connections 8192; | |
| } | |
| #Stream segment at root level of config! | |
| stream { | |
| upstream 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 servers_http; | |
| } | |
| upstream 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 servers_https; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment