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的更多相关文章

  1. 对比Haproxy和Nginx负载均衡效果

    为了对比Hproxy和Nginx负载均衡的效果,分别在测试机上(以下实验都是在单机上测试的,即负载机器和后端机器都在一台机器上)做了这两个负载均衡环境,并各自抓包分析.下面说下这两种负载均衡环境下抓包 ...

  2. nginx负载均衡集群

    nginx负载均衡集群  0.前言:nginx 负载均衡,属于网络7层模型中的应用层,说白了就是一个代理,要用 upstrem 模块实现,代理则用proxy模块 1.可以针对域名做转发,lvs只能针对 ...

  3. 手把手教你玩转nginx负载均衡(二)----安装虚拟机操作系统

    引言 在上一篇,我们组装好了虚拟机的硬件部分,那么现在我们就要把操作系统装上了,既然是服务器,那么安装linux操作系统是个比较好的选择,如果你喜欢的话,安装windows也是没有任何问题的 我这里选 ...

  4. nginx负载均衡基于ip_hash的session粘帖

    nginx负载均衡基于ip_hash的session粘帖 nginx可以根据客户端IP进行负载均衡,在upstream里设置ip_hash,就可以针对同一个C类地址段中的客户端选择同一个后端服务器,除 ...

  5. Net分布式系统之二:CentOS系统搭建Nginx负载均衡

    一.关于CentOS系统介绍 CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一,它是来自于Red Hat ...

  6. Net分布式系统之三:Keepalived+LVS+Nginx负载均衡之高可用

    上一篇写了nginx负载均衡,此篇实现高可用(HA).系统整体设计是采用Nginx做负载均衡,若出现Nginx单机故障,则导致整个系统无法正常运行.针对系统架构设计的高可用要求,我们需要解决Nginx ...

  7. 配置nginx负载均衡

    配置nginx负载均衡 执行命令:vi /usr/local/nginx/sbin/nginx/conf/nginx.conf 修改为: worker_processes  2; events {   ...

  8. 烂泥:nginx负载均衡

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 今天我们来学习下有关nginx的负载均衡配置.nginx的负载均衡是通过nginx的upstream模块和proxy_pass反向代理来实现的. 说明: ...

  9. nginx负载均衡集群中的session共享说明

    在网站使用nginx+php做负载均衡情况下,同一个IP访问同一个页面会被分配到不同的服务器上,如果session不同步的话,就会出现很多问题,比如说最常见的登录状态. 下面罗列几种nginx负载均衡 ...

随机推荐

  1. vs2010 使用SignalR 提高B2C商城用户体验(二)

    vs2010 使用SignalR 提高B2C商城用户体验(二) 上一节,已经实现了,当前域内的通信,这一节中,介绍一下跨域的即时通信,既然要做,我们肯定要把这个推送及聊天服务器做为一个单独的服务器,以 ...

  2. FormBorderStyle.None 时候最大化不遮盖任务栏

    this.FormBorderStyle = FormBorderStyle.None;             this.MaximumSize = new Size(Screen.PrimaryS ...

  3. 团体程序设计天梯赛-练习集L1-007. 念数字

    L1-007. 念数字 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 翁恺 输入一个整数,输出每个数字对应的拼音.当整数为负数时,先 ...

  4. jquery 清空动态append添加元素,remove方法

    <html> <head> <script type="text/javascript" src="jquery-1.9.1.js" ...

  5. eclipse查看jar包中class的中文注释乱码问题的解决

    1,问题来源是在eclipse中直接查看springside的class(由eclipse自动反编译)里面注释的乱码问题: Preferences-General-Workspace-Text fil ...

  6. Objective-C 协议(protocol)

    协议(protocol)是Objective-c中一个非常重要的语言特性,从概念上讲,非常类似于JAVA中接口. 一个协议其实就是一系列有关联的方法的集合(为方便后面叙述,我们把这个协议命名为myPr ...

  7. mvc+entity framework database first,生成的model每次更新一个表会更新所有的model

    在使用Entity Framework 的Database frist或model first时,直接加attribute到modle类上是太现实也不合理的,因为model类是自动生成的,重新生成后会 ...

  8. [itint5]二叉树转换线索二叉树

    http://www.itint5.com/oj/#27 用了基于stack的中序遍历,记录一下last,就很简单了. #include <stack> /*树结点的定义(请不要在代码中定 ...

  9. orm框架与缓存的关系

    1.mybatis规定,一级缓存没必要bean类实现序列化,但二级缓存bean类必须实现序列化. 因为二级缓存是基于namespace的也就是基于接口的,二级缓存可以设置存储源,可以是redis或者m ...

  10. 113. Path Sum II

    题目: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the give ...