nginx转发ftp服务

在 http{}之外写以下参数

stream {
    upstream ftp{
        hash $remote_addr consistent;
        server 192.168.43.12:21;
    }
    
    server {
        listen 8012;
        proxy_connect_timeout 300s;
        proxy_timeout 300s;
        proxy_pass ftp;
   }
}

访问8012端口时转发至ftp服务:192.168.43.12:21

 

说明:文档参考地址:

https://www.yht7.com/news/176761

https://blog.csdn.net/yeahpeople/article/details/116703823

posted on 2022-09-26 15:26  wangzy-Zj  阅读(1221)  评论(0编辑  收藏  举报