nginx.conf
添加内容
stream
和http
同级,在http
块下添加下面内容
include /etc/nginx/conf.d/*.stream;
创建ssh.stream
文件
stream {
upstream sshproxy {
hash $remote_addr consistent;
server 172.16.0.1:22;
}
server {
listen 2333;
proxy_pass sshproxy;
}
}
- 使用
web
服务器的2333
端口连接172.16.0.1
的22
端口