码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx负载均衡SFTP

时间:2016-12-12 19:11:28      阅读:1135      评论:0      收藏:0      [点我收藏+]

标签:负载均衡   figure   sdn   image   sftp   html   log   技术   style   

1、CentOS安装SFTP,参考

2、Nginx-1.8.1 下载 ,Nginx_TCP插件 下载 

3、安装Nginx

[root@localhost nginx-1.8.1]# yum -y install pcre*
[root@localhost nginx-1.8.1]# yum -y install openssl*
[root@localhost nginx-1.8.1]# patch -p1 < /root/nginx_tcp_proxy_module-master/tcp.patch
[root@localhost nginx-1.8.1]# ./configure --add-module=/root/nginx_tcp_proxy_module-master
[root@localhost nginx-1.8.1]# make
[root@localhost nginx-1.8.1]# make install

4、配置Nginx

user  nginx nginx;
worker_processes  4;

events {
worker_connections  512000;
}

tcp {

    upstream sftp{
        server 192.168.208.141:22;
        server 192.168.208.142:22;
        check interval=3000 rise=2 fall=5 timeout=1000;
    }

    server {
        listen 8080;
        proxy_pass sftp;
    }

}

5、添加nginx用户

[root@localhost nginx-1.8.1]# useradd nginx

6、启动Nginx

[root@localhost nginx-1.8.1]# /usr/local/nginx/sbin/nginx

7、关闭防火墙

[root@localhost nginx-1.8.1]# service iptables stop

8、winscp连接

技术分享

 

参考资料:

http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=29791971&id=4702007

http://www.voidcn.com/blog/anonxiaozi/article/p-5529154.html

https://github.com/yaoweibin/nginx_tcp_proxy_module

 

Nginx负载均衡SFTP

标签:负载均衡   figure   sdn   image   sftp   html   log   技术   style   

原文地址:http://www.cnblogs.com/i-blog/p/6165378.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!