You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just installed the mod_proxy_protocol module, but having problems getting this working.
I have been able to get the PROXY header parsing working and I can see that the control data stream is working fine, but the problem comes when I try the data part of it (listing, downloading and so on).
The first problem comes with plain-text ftp sessions, where the entering passive mode ip address needs to be rewritten. If I use masqueradeaddress and set this to the ip address of the proxy server, then my firewall blocks it on the way from the ftp server to the proxy. But if I don't set masqueradeaddress and then just let the private, non-routable ip be present in that packet, then my firewall blocks that on the outside interface.
So I then wanted to resort to using TLS to hide this information from the fw, so I configured up TLS and got to the same point. I can authenticate, but when I attempt to list anything, it stops. When looking at the tls.log I see the following:
2024-01-23 17:00:43,843 mod_tls/2.9[13584]: unable to accept TLS connection: protocol error:
(1) error:0A00010B:SSL routines::wrong version number
2024-01-23 17:00:43,843 mod_tls/2.9[13584]: unable to open data connection: TLS negotiation failed
If I connect directly to the server without using the proxy server, then tls works just fine, so it has to be the proxy thing messing things up.
PassivePorts 31000 32000
<IfModule mod_proxy_protocol.c>
# Enable PROXY protocol support for clients in this class
ProxyProtocolEngine on
ProxyProtocolTimeout 3sec
ProxyProtocolVersion haproxyV2
# Necessary to allow data transfers from this class
AllowForeignAddress on
</IfModule>
In modules.conf I have this at the bottom of the file:
# keep this module the last one
LoadModule mod_ifsession.c
# no, this should be the last one
LoadModule mod_proxy_protocol.c
Another note, I tried using the class and ifclass to restrict where to load the proxy or not and that seems to not stick at all. I'm not sure if I've missed something here. ifsession is loaded - here's the output of a common reload of the service:
The first issue, regarding data transfers, is covered in the FAQ section, at the end of the documentation, hopefully.
The second issue, regarding <IfClass>, pertains to the module ordering. You do want the mod_ifsession module to the be last module listed. The documentation isn't quite clear on this, since the module ordering depends on specific features/functionality provided by different modules; not all modules are the same.
In this particular case, I think your modules.conf should end with:
LoadModule mod_proxy_protocol.c
# keep this module the last one
LoadModule mod_ifsession.c
This way, mod_ifsession will be the first module to handle incoming connections -- and will apply/handle any <IfClass> sections because of that; this module does not read any data from the TCP connection. Next, mod_proxy_protocol would handle the connection event, would read the PROXY header, and do its thing.
I've just installed the mod_proxy_protocol module, but having problems getting this working.
I have been able to get the PROXY header parsing working and I can see that the control data stream is working fine, but the problem comes when I try the data part of it (listing, downloading and so on).
The first problem comes with plain-text ftp sessions, where the entering passive mode ip address needs to be rewritten. If I use masqueradeaddress and set this to the ip address of the proxy server, then my firewall blocks it on the way from the ftp server to the proxy. But if I don't set masqueradeaddress and then just let the private, non-routable ip be present in that packet, then my firewall blocks that on the outside interface.
So I then wanted to resort to using TLS to hide this information from the fw, so I configured up TLS and got to the same point. I can authenticate, but when I attempt to list anything, it stops. When looking at the tls.log I see the following:
If I connect directly to the server without using the proxy server, then tls works just fine, so it has to be the proxy thing messing things up.
Here's my relevant config:
haproxy:
Relevant proftpd configuration:
In modules.conf I have this at the bottom of the file:
Another note, I tried using the class and ifclass to restrict where to load the proxy or not and that seems to not stick at all. I'm not sure if I've missed something here. ifsession is loaded - here's the output of a common reload of the service:
What am I missing here?
The text was updated successfully, but these errors were encountered: