HAproxy中的FTP连接

问题描述 投票:0回答:1

我第一次使用HAproxy。这是我的HAproxy conf。文件,一切正常,没有FTP连接。

另外,在其他客户服务器上安装pure-ftp,我是否必须在客户机上进行更改?

我无法通过FTP访问服务器。

 global
log 127.0.0.1   local0
 log 127.0.0.1   local1 notice
#log loghost    local0 info
maxconn 4096
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
stats socket /var/lib/haproxy/stats

 defaults
log     global
mode    http
option  httplog
option  dontlognull
retries 3
redispatch
maxconn 2000
contimeout      5000
clitimeout      50000
srvtimeout      50000

listen stats
bind *:8080
    mode http
    option forwardfor
    option httpclose
    stats enable
    stats show-legends
    stats refresh 5s
    stats uri /stats
    stats realm Haproxy\ Statistics
    stats auth hello:world
    stats admin if TRUE

frontend MAIN 
bind *:21 
bind *:80 
bind *:143 
bind *:443 
bind *:993 
mode http 

    acl server1_URL hdr_dom(host) -i domain1.com
    acl server2_URL hdr_dom(host) -i domain2.com

use_backend server1 if server1_URL
use_backend server2 if server2_URL  

backend server1
mode http
server web-first 192.168.1.2:80

backend server2
mode http
server web-first 192.168.1.3:80

我试过这个:它没用

listen FTP :21,:10000-10250
mode tcp
server ftp01 192.168.1.2 check port 21
server ftp01 192.168.1.3 check port 21

我该怎么办呢?谢谢。

haproxy
1个回答
0
投票

您需要在pure-ftpd配置文件中设置ForcePassiveIP设置。它应该设置为前端代理的IP。此外,请确保PassivePortRange设置与您在HAproxy配置中的设置相匹配。

FTP协议不是直接代理,因为它建立多个连接,但在tcp层执行它应该没问题。

© www.soinside.com 2019 - 2024. All rights reserved.