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; #转发请求
}
}
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了
