添加stream模块
在nginx源码目录中,安装stream模块
./configure --with-stream
make
make install
将生成的nginx执行文件拷贝到/usr/local/nginx/sbin
-------------------------
修改配置:
http {
}
stream {
upstream udpserver {
server ip:端口;
}
server {
listen 端口 udp;
proxy_connect_timeout 1s;
proxy_timeout 20s;
proxy_pass udpserver;
}
}
来源:oschina
链接:https://my.oschina.net/garlicts/blog/4830377