Mail Proxy for two domains nehind NAT

Maxim Dounin mdounin at
Mon Feb 12 12:50:31 UTC 2018


On Sun, Feb 11, 2018 at 08:57:04PM -0500, entpneur wrote:

> Hello,
> I tried to setup NGiNX as a Mail Proxy for two domains behind NAT.  Users
> will be diverted to the right server base on domain (eg./ user at
> will be diverted to Server A and user at will be diverted to Server
> B).
> When I test the nginx.conf it gives me the following:
> "nginx: [emerg] duplicate "" address and port pair ..."
> After some digging, I know that the listen directive need to have different
> address:port pair but reuseport option is not allow in mail context. 
> Is there a way to overcome or achieve that?  Please Help!  TIA!

If you want to distinguish different clients based on what they 
provide during authentication, you have to use single server{} block 
for this, and then introduce required distinction at 
authentication level in your auth_http script.

Maxim Dounin

More information about the nginx mailing list