nginx 代理ftp


 

 

nginx1.9之后直接使用Stream配置就可以了,當然需要先安裝stream模塊

1.nginx 增加tcp

./configure --with-stream --with-pcre=../pcre-8.38 ./configure --with-stream --without-http_rewrite_module

 

 

2.配置nginx.conf

http {
    ……
}

stream {    
    upstream sftp{
        hash $remote_addr consistent; server 172.0.0.1:22 max_fails=3 fail_timeout=30s; } server { listen 8080; proxy_connect_timeout 1s; proxy_timeout 30s; proxy_pass sftp; } }

 

資料:

https://www.cnblogs.com/tinywan/p/6965467.html
https://zhangge.net/5037.html
https://blog.csdn.net/errizh/article/details/77936422

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM