1 .需求背景
2 .安装nginx查看nginx的脱机安装
在此补充:代理ftp端口需要nginx流模块,因此在配置nginx时必须携带参数。
- -使用流
核心配置:
stream { upstream FTP服务器} server 172.16.2.30336040000 max _ fails=3fail _ time out=5s weight=1; } #控制连接请求server { listen 34000; #监听端口proxy_next_upstream on重试失败; proxy_next_upstream_timeout 0; proxy_next_upstream_tries 0; #超时配置proxy_connect_timeout 1s; proxy_timeout 10m; #限速配置proxy_upload_rate 1024k; proxy_download_rate 2048k; #上游服务器proxy_passFTP服务器; } upstream FTP _ pas v1 { server 172.16.2.30336040001 max _ fails=3fail _ time out=5s weight=1; } upstream FTP _ pas v2 { server 172.16.2.30336040002 max _ fails=3fail _ time out=5s weight=1; } upstream FTP _ pas v3 { server 172.16.2.30:40003 max _ fails=3fail _ time out=5s weight=1; } #数据连接请求server { listen 34001; proxy_pass ftp_pasv1; }服务器{ listen 34002; proxy_pass ftp_pasv2; }服务器{ listen 34003; proxy_pass ftp_pasv3; }3.安装vsftp查看vsftp的安装
核心配置:
关闭DNS反向分析,提高登录认证速度。 reverse_lookup_enable=NO #监听端口打开listen_port=40000#被动模式,pasv_enable=YES#数据传输端口最小值pasv _ min