Do you have an example for reverse proxying all mailserver traffic through Nginx ? #4430
Replies: 1 comment
-
|
Generally there is little value in putting DMS behind a reverse proxy. You rarely have more than one service that needs to route from those ports that DMS is using for mail, so what other benefits are you seeking beyond TLS being terminated at the reverse proxy instead of DMS? There is often a misunderstanding with that guide, it is meant to demonstrate how to support deployments where such a setup is necessary (it was documented for kubernetes ingress). It's otherwise extra complexity to manage with no real benefit? Publish the DMS ports and give DMS access to the certificate it needs to manage TLS on it's end. Unless you know a specific reason to require this setup, you shouldn't need it. Nginx feedbackIf you still choose to pursue this, I cannot assist you that much. I will provide you with some context and corrections to get you started.
Nginx is a little different there in having For port 465,
If instead you want to configure Nginx more like the existing Traefik guide does, you pass the connection through to DMS. There were two configurations covered in that guide:
In both cases the DMS ports that the reverse proxy routes traffic to are modified via config to use PROXY Protocol. You have no configured Nginx to use that. You must do this to correctly preserve the client IP, otherwise all traffic to DMS would be appearing to come from the reverse proxy IP (which is likely in the same private subnet of the DMS container, and thus some config may trust this IP to bypass some security IIRC), you do not want this mistake. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using Nginx as my reverse proxy, with multiple plugins such as geoip restrictions, crowdsec bouncer... so I would like all my mailserver traffic (including mail traffic on ports 25, 587, imap...) to go through Nginx.
I have read https://docker-mailserver.github.io/docker-mailserver/latest/examples/tutorials/mailserver-behind-proxy/#reverse-proxy . That is what I want to achieve, but with Nginx instead of Traefik.
Nginx does provide a starting point, but I believe there is much more to set up to tailor it to DMS https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/. So far I have tried the following:
but with no success.
Do you have an example, somewhere, of the equivalent configuration for Nginx ?
I would like to ask for help to set that up.
Thanks in advance for any answer, have a nice day.
Beta Was this translation helpful? Give feedback.
All reactions