Linux操作记录2--Nginx代理端口

Nginx 安装

参照这个链接就好了
http://nginx.org/en/linux_packages.html#RHEL
使用nginx -V, 看到如下界面,就OK了

Nginx配置

在/etc/nginx/nginx.conf最下面加入如下代码
shell stream { upstream ssh{ server 127.0.0.1:22; } server { listen 8022; proxy_connect_timeout 1h; proxy_timeout 1h; proxy_pass ssh; } }

重载配置

systemctl reload nginx
然后就可以用8022端口去连接服务器啦