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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步