zoukankan      html  css  js  c++  java
  • Nginx负载均衡SFTP

    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

  • 相关阅读:
    Redis 思维导图 (解析版)
    一张图片了解redis
    Redis 思维导图
    计算机网络协议
    IT笔面试题
    Hadoop集群搭建
    天涯论坛只看楼主
    齐秦&r大约在冬季现场版
    郁可唯茶汤现场版
    MTK平台电路设计01
  • 原文地址:https://www.cnblogs.com/i-blog/p/6165378.html
Copyright © 2011-2022 走看看