首页 > 代码库 > Nginx stream(TCP/UDP)负载均衡
Nginx stream(TCP/UDP)负载均衡
Nginx-1.11.6编译安装
nginx编译安装,(平台:ubuntu 14.04); sudo apt-get install zlib1g-dev sudo apt-get install libpcre++-dev sudo apt-get install openssl 然后configure: --with-stream 支持TCP/UDP负载均衡 cd nginx-1.11.6/ ./configure --with-stream --prefix=/home/trait/nginx make & make install
Nginx stream UDP负载均衡配置
nginx udp负载均衡配置: root@trait:/home/trait/nginx/sbin# cat ../conf/nginx.conf #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; } stream { upstream dns { server 192.168.111.99:10086; server 192.168.111.100:10086; } server { listen 192.168.111.98:10086 udp; proxy_responses 1; proxy_timeout 20s; proxy_bind $server_addr:$remote_port; proxy_pass dns; } }
Nginx stream(TCP/UDP)负载均衡
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。