Mail-In-A-Box Behind Nginx Reverse Proxy

Hi All,

I don’t know this scenario is supported by the Mail-In-A-Box development team. But I hope this is very much useful/helpful for the end user if it can run behind a reverse proxy scenario.

I have my setup as follows.

  1. Router connects to the internet
  2. All mail ports are forwarded directly to the mail-in-a-box server ip. Except http/s Port 80 and 443
  3. Port 80 and port 443 forwarded to the Nginx reverse proxy server
  4. I have separate server for websites. Nginx reverse proxy correctly works with the backend web server.

My requirement is to access mail-in-a-box admin and mail interface thru the reverse proxy. All other settings of mail-in-a-box seems to be working perfectly. (Ex. mta-sts.example.com)

When I did like other websites, https://box.example.com gets looped redirection which will never ends. Hope that is due to https configuration of the mail-in-a-box server.

Did anyone face such scenario and is there any luck to do this. Otherwise, we have to get dedicated IP to host mail server and another IP for web hosting.

Thanks