HAProxy community

Ftp connexion trough haproxy

#1

Hello!

At the moment I have two servers under centos 7.

  • 10.10.104.200 = Loadbalencer with Haproxy
  • 10.10.105.100 = web server

I want the clients to enter their ftp (ex Filezilla) 10.10.104.200 and be redirected automatically to the server 10.10.105.100. I still have not found a way that works well … Thank you very much for helping me.

Here is my current configuration of haproxy.cfg:

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon

defaults
log global
mode http
option httplog
option tcplog
retries 3
maxconn 10000
option redispatch
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000

frontend http_front
bind *:80
default_backend http_back

backend http_back
balance roundrobin
server serveurBack 10.10.105.100:80 check

listen stats
bind *:8181
stats enable
stats uri /
stats realm Haproxy\ Statistics
stats auth :

frontend ftp-pool
bind *:21 transparent
bind *:30000-35020 transparent
mode tcp
maxconn 2000
option tcplog
option tcp-check
default_backend ftp-pool-backend

backend ftp-pool-backend
balance source
hash-type consistent
server ftp01 10.10.105.100 check port 21

backend ftp-pool-backend-static
balance source
hash-type consistent

THX!
Have a good day

0 Likes

#2

You need to set PASV address to your external IP in ftp configuration.

1 Like