Nginx4层反向代理

模块:ngx_stream_core_module 在1.9.0版本之后加入
模块不是默认安装,需要在编译的时候加上–with-stream
配置文件内容要写在http层外面
stream {
upstream tcp_proxy; {
hash $remote_addr consistent;
server 10.125.192.2:22;
}
server {
listen 2222 so_keepalive=on;
proxy_connect_timeout 1s;
proxy_timeout 30s;
proxy_pass tcp_proxy;
}
}

猜你喜欢

转载自blog.csdn.net/bjgaocp/article/details/87921475