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
