# Use HAProxy to different FTPS servers

**URL:** <https://discourse.haproxy.org/t/use-haproxy-to-different-ftps-servers/6182>\
**Category:** Help!\
**Created:** [January 25, 2021, 12:43pm UTC](https://discourse.haproxy.org/t/use-haproxy-to-different-ftps-servers/6182 "2021-01-25T12:43:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hennning](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@hennning](https://discourse.haproxy.org/u/hennning)\
**Post date:** [January 25, 2021, 12:43pm UTC](https://discourse.haproxy.org/t/use-haproxy-to-different-ftps-servers/6182/1 "2021-01-25T12:43:40Z")

</div>

I am running a datacenter for different customers and use HAProxy to different servers based on the domain they connect with. This works really great.

Now I want to extend this to allow our customers to also setup internal FTPS servers through a proxy.

The reason we do this is to preserve external IPs as much as possible.

As I understand it, FTP does support Host Headers as long as the FTP server have implemented that feature which Microsoft IIS (in this case) does.

My question is, how can I configure a HAProxy ACL to lookup the host header and direct traffic based on domain name?

I have tried the following without success:

#FRONTEND CONFIG  
frontend fe\_ftp  
bind (haproxy-ip):21 transparent  
bind (haproxy-ip):50010-50020 transparent  
option tcplog  
mode tcp  
#ACL Lists  
#FTP ACL  
acl [ftp-test.xyz.com](http://ftp-test.xyz.com) req.ssl\_sni -i [ftp-test.xyz.com](http://ftp-test.xyz.com)  
use\_backend be\_ftp if [ftp-test.xyz.com](http://ftp-test.xyz.com)

#default\_backend be\_ftp

#BACKEND CONFIG  
backend be\_ftp  
mode tcp  
balance source  
hash-type consistent  
stick on src  
stick-table type ip size 10240k expire 30m  
server [ftp-test.xyz.com](http://ftp-test.xyz.com) 10.0.30.10 check port 21 inter 10s rise 2 fall 2

If I remove the comment on “default\_backend be\_ftp” everything works like a charm.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [January 26, 2021, 7:55pm UTC](https://discourse.haproxy.org/t/use-haproxy-to-different-ftps-servers/6182/2 "2021-01-26T19:55:32Z")

</div>

> [@hennning](#):
>
> As I understand it, FTP does support Host Headers as long as the FTP server have implemented that feature which Microsoft IIS (in this case) does.

No, it does not.

Neither the control traffic on port 21 looks like SSL with a SNI value, nor does the data traffic on the higher ports.
