Nginx从1.9.13起开始发布ngx_stream_core_module模块不仅能支持TCP代理及负载均衡,其实也是支持UDP协议的。
1.Nginx下载
wget http://nginx.org/download/nginx-1.24.0.tar.gz
2.Nginx安装
#yum -y install proc* openssl* pcre*
# tar -zxvf nginx-1.24.0.tar.gz
#cd nginx-1.24.0
# ./configure --prefix=/usr/local/nginx --with-stream
# make && make install
3.Nginx配置文件
#user nobody;
worker_processes auto;
worker_cpu_affinity auto;
worker_rlimit_nofile 100000;#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;#pid logs/nginx.pid;
events {