nginx代理mysql,ssh

时间:2021-09-10 00:59:59   收藏:0   阅读:27

nginx代理mysql,ssh

stream {
    upstream mysqlstream {
        server 127.0.0.1:3306;
    }
    server {
 	 listen 13306;#可自定义
	 proxy_connect_timeout 10s;
	 proxy_timeout 300s;
  	 proxy_pass mysqlstream;
    }
 }

stream {
    upstream sshstream {
        server 127.0.0.1:22;
    }
    server {
 	 listen 10022;#可自定义
	 proxy_connect_timeout 10s;
	 proxy_timeout 300s;
  	 proxy_pass sshstream;
    }
 }
## 打开防火墙
iptables -I INPUT -p tcp --dport  13306 -j ACCEPT
iptables -I INPUT -p tcp --dport  10022 -j ACCEPT

原文:https://www.cnblogs.com/stringfade/p/15246501.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!