nginx TCP转发配置
nginx1.90对TCP协议的代理并不是默认开启的,需要在编译的时候配置 --with-stream 参数
进入原有nginx源码目录
- ./configure --prefix=/usr/local/nginx --with-stream
- make
- make install
配置nginx
conf/nginx.conf
-
stream {
upstream proxy_card {
# simple round-robin 转发IP和端口
server 192.168.1.12:12340;
server 192.168.1.13:12340;
#check interval=3000 rise=2 fall=5 timeout=1000;
#check interval=3000 rise=2 fall=5timeout=1000
#check interval=3000 rise=2 fall=5timeout=1000
#check_http_send "GET /HTTP/1.0 ";
#check_http_expect_alive http_2xxhttp_3xx;
}
server {
listen 12340; #监听端口
proxy_pass proxy_card; #转发请求
}
}
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: tp5 多图上传(适应h5、flash,多图上传)
- 下一篇: 关于UEditor配合TP框架使用