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. [转载]C#对象序列化与反序列化

    文章写的实在是太好了,忍不住转来: http://www.cnblogs.com/LiZhiW/p/3622365.html#_Toc8478 1.对象序列化的介绍 (1).NET支持对象序列化的几种 ...

  2. SSH开发框架搭建参考

    一, 参考文章: 1, http://blog.csdn.net/communicate_/article/details/8644040 这篇文章讲的还算详尽,但是貌似有一些多余的代码: 2,

  3. (转)基于即时通信和LBS技术的位置感知服务(三):搭建Openfire服务器+测试2款IM客户端

    主要包含4个章节: 1. Java 领域的即时通信的解决方案 2. 搭建 Openfire 服务器 3. 使用客户端测试我们搭建的 Openfire 服务器 4. Smack 和 ASmack 一.J ...

  4. uva 11151

    求最长回文串  就是将字符串翻转后求最长公子列..... #include <cstdio> #include <cstdlib> #include <algorithm ...

  5. ural 1200

    推出公式  然后特判两端  代码其实挺烂      但是有人竟然可以直接暴过去的 ...... #include <cstdio> #include <cstring> #in ...

  6. Manifest 与TypeTag

    Manifest和TypeTag是要解决什么问题?   As with other JVM languages, Scala’s types are erased at compile time. T ...

  7. wordpress如何删除没有文章的tags标签

    wordpress站点除了可以按博客category分类外,还可以在写文章的时候适当添加tags标签(当然,if you are lazy,哈哈,可以安装auto tag插件来实现),发布的posts ...

  8. Unity寻路的功能总结

    源地址:http://blog.csdn.net/sgnyyy/article/details/21878163 1. 利用Unity本身自带的NavMesh 这篇文章已经比较详细,可能对于很多需要a ...

  9. jsp request.getParameterValues获取数组值代码示例

    tt.jsp <form action="tt2.jsp" method="POST"> <select name="two&quo ...

  10. ajax返回正个页面