1

I have so far been unable to find a Ubuntu package or configuration that would allow for me to accomplish reverse proxy using subdomains to an internal ftp server like this:

 FTP Client > ftp://abc.mydomain.com > ftp://some.lan.machine.or.ip
 FTP Client > ftp://xyz.mydomain.com > ftp://some.other.lan.machine.or.ip

I believe that Nginx does not support FTP, so is there another solution that would allow for an FTP reverse proxy by subdomain? Minimally, standard port 21 is all that is required, and of course the proxy solution should be resistant to attacks. The internal servers also run on Ubuntu with pure-ftpd with virtual user authentication.

Inator
  • 994
  • 2
  • 14
  • 33

2 Answers2

2

Using ProFTPD's mod_proxy module, you should now be able to accomplish this. For example, you would configure mod_proxy to proxy these domains like so:

<VirtualHost abc.mydomain.com>
  ProxyEngine on
  ProxyTables /var/ftpd/proxy.d/abc

  # Act as a reverse proxy for these servers
  ProxyRole reverse
  ProxyReverseServers ftp://some.lan.machine.or.ip
</VirtualHost>

<VirtualHost xyz.mydomain.com>
  ProxyEngine on
  ProxyTables /var/ftpd/proxy.d/xyz

  # Act as a reverse proxy for these servers
  ProxyRole reverse
  ProxyReverseServers ftp://some.other.lan.machine.or.ip
</VirtualHost>

If your FTP clients do not use the new FTP HOST command (for true name-based domains in FTP), then the "abc.mydomain.com" and "xyz.mydomain.com" DNS names will need to resolve to different IP addresses (or the above vhosts will need separate ports). But hopefully your FTP clients do support HOST, so that the above configuration can work using the same IP address and port.

Hope this helps!

Community
  • 1
  • 1
Castaglia
  • 2,972
  • 5
  • 28
  • 49
  • I don't think that this configuration still valid? Becuase, I have been trying it over and over without any success. I have tried Transmit, FileZilla even FlashFXP – hasusuf Sep 29 '17 at 15:49
  • @HassanYoussef Yes, it works -- please contact me directly for additional triage/debugging/discussion. – Castaglia Oct 06 '17 at 12:53
0

I've been looking for the same thing and found this web page describing how to setup forward and reverse ftp proxy. I have not tested it yet though.