nginx把ssh请求转发给后端服务器

stream{
upstream backup{
server 103.229.213.228:22;
server 103.229.215.172:22;

}
server{
listen 12345;
#proxy_connect_timeout 1s;
#proxy_timeout 3s;
proxy_pass backup;     //请求处理不了,转发给 backup的服务端
}
}

 

 [root@10-100-10-21 ~]# ssh  -p 12345 163.53.168.43   

 

 

 

 

 

upstream webserver{
ip_hash;
server 103.229.213.228:8080 max_fails=1 fail_timeout=30;
server 103.229.215.172:8080;
#server 103.229.215.172:8080 down;
}

 

posted @ 2021-12-28 15:59  taotao12  阅读(365)  评论(0编辑  收藏  举报