Use HTTP_HOST instead of SERVER_NAME in RewriteRule
https://mailcow.github.io/mailcow-dockerized-docs