配置Nginx四層負載均衡
阿新 • • 發佈:2018-11-06
連接 nginx 架構 技術分享 work str ice 實現 light
nginx 支持TCP轉發和負載均衡的支持
實現下面的架構:
看配置:
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } tcp { upstream toov5{ server 192.168.8.159:8081 ; server 192.168.8.159:8080; } server { listen 9999; server_name 192.168.91.5; proxy_pass toov5; } }
短小精悍!
連接 server1 斷開 在連接到 server2 就這樣的輪訓~~~
配置Nginx四層負載均衡