NGINX通过Stream转发ftp请求


一、NGINX 1.9之前,需要安装第三方的TCP插件:

http://www.cnblogs.com/i-blog/p/6165378.html

二、1.9之后直接使用Stream配置就可以了,当然需要先安装stream模块:

1.nginx 增加tcp
./configure --with-stream --with-pcre=../pcre-8.38
./configure --with-stream --without-http_rewrite_module
2.配置nginx.conf


stream { 
upstream sftp { 
hash $remote_addr consistent; 
server 127.0.0.1:22 max_fails=3 fail_timeout=30s; 

server { 
listen 90; 
proxy_connect_timeout 1s; 
proxy_timeout 3s; 
proxy_pass sftp; 

}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM