Nginx四层转发vsftp

1.需要安装stream模块
2.在nginx.conf默认配置文件添加如下配置即可
stream { log_format tcp
'$remote_addr [$time_local] ' '$protocol $status $bytes_sent $bytes_received ' '$session_time "$upstream_addr" ' '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; upstream i2_rf { hash $remote_addr consistent; server 10.0.2.137:6666 max_fails=3 fail_timeout=30s; server 10.0.2.138:6666 max_fails=3 fail_timeout=30s; } server { listen 6666 so_keepalive=on; ## 系统端口 access_log logs/i2_rf-access.log tcp; error_log logs/i2_rf-error.log error; proxy_pass i2_rf; }
# include stream/*.conf; 另起目录 }

 

posted @ 2019-08-22 08:22  善战者求之于势  阅读(607)  评论(0编辑  收藏  举报