nginx新增stream模塊負載ftp請求

nginx 1.9版本之後直接使用Stream

安裝stream模塊:

1.nginx 增加tcp
./configure --with-stream (新增配置,其餘根據自己需求不變)

2.配置nginx.conf

stream {
upstream ftp {
hash $remote_addr consistent;
server 192.168.1.2:21 max_fails=3 fail_timeout=30s;

server 192.168.1.3:21 max_fails=3 fail_timeout=30s;
}
server {
listen 2121;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass sftp;
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章