Redirect webmail.mydomain.example to box.mydomain.example/mail

Hello,
can you please advise how to redirect URL webmail.mydomain.example to box.mydomain.example/mail.

I know this topic has been discussed several times in this forum, however I didn’t find a solution that will survive miab update and won’t modify file /etc/nginx/conf.d/local.conf.

I think a promising solution is documented here, but I cannot find a directive in /etc/nginx/conf.d/local.conf that fetches information from directory /etc/nginx/conf.d/includes/.

THX

This looks promising.

Thanks for sharing this information.

Do you agree that I need to maintain a custom DNS A-record in Mail-in-a-Box > Control panel for webmail.mydomain.example, too?

I created file /home/user-data/www/custom.yaml with this content:

webmail.mydomain.example:
    redirects:
        ^/$: https://box.mydomain.example/mail

Then I modified file ownership to user-data.root and executed command sudo ~/mailinabox/tools/web_update.
My expectation is that this would modify nginx directives.

However verifying the content of any file in /etc/nginx shows there’s now file that includes string “webmail”.

Just tried this myself. You don’t need to add a DNS entry, but you do need to add a user or alias that makes use of the domain, e.g. someuser@webmail.domain.example in addition to updating the custom.yaml file.

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.