Welcome! Log In Create A New Profile

Advanced

ftp proxy with nginx

Posted by shakenfr 
ftp proxy with nginx
June 05, 2017 07:41AM
hello,

I have a proxmox solution for virtualisation.
On each virtual machine there's a ftp service
On the node I put nginx (1.13) to proxy http/https between virtual machines and it's works well; but for FTP it does'nt work

1- Is it possible ?
2 - Has someone an example configuration ? (the idea is to use ftp.domain.fr to proxy on the first VM and ftp-preprod.domain.fr must be routed to & second VM

best
bruno
Re: ftp proxy with nginx
June 05, 2017 08:38AM
I strongly suggest eradicating FTP with extreme prejudice.
Use SFTP or SCP at least.
Re: ftp proxy with nginx
June 05, 2017 12:58PM
it's another problem the protocol . ftp or sftp I think it's the same problem. How to route to correct VM ?
Re: ftp proxy with nginx
June 05, 2017 05:40PM
No, the problem is different, because protocols are inherently different.
SSH is easily proxied. FTP is not.
Re: ftp proxy with nginx
June 07, 2017 10:41AM
I see this interesting module, it's seems to work with ftp but ...

https://www.nginx.com/resources/admin-guide/tcp-load-balancing/

but... I don't know how to configure it for using different subdomains in source

the server_name directive is not allowed inside stream module


so at the moment I have this

stream {
server {
listen 21;
proxy_pass ip_vm_1:21;
}
server {
listen 20;
proxy_pass ip_vm_1:20;
}
}

when I introduce this it doesn't work

stream {
server {
listen 21;
server_name preprod.domain.fr
proxy_pass ip_vm_1:21;
}
server {
listen 20;
server_name preprod.domain.fr
proxy_pass ip_vm_1:20;
}
server {
listen 21;
server_name prod.domain.fr
proxy_pass ip_vm_2:21;
}
server {
listen 20;
server_name prod.domain.fr
proxy_pass ip_vm_2:20;
}


== server_name is not allowed here --> KO

How can I differanciate the source subdomain ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 230
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready