I have two domains configured within Mailcow. mail.domain1.org and mail.domain2.org. Mailcow UI works fine with http(s)://mail.domain1.org.
Ideally, I’d like http(s)://mail.domain2.org to present the Mailcow UI without redirecting.
But to start, I’d like it to redirect correctly first. At the moment, https://mail.domain2.org will redirect correctly. However, http://mail.domain2.org will redirect to https://domain.org. Some of my conf files in /opt/mailcow-dockerized/data/conf/nginx:
To attempt the mailcow UI redirect mail.domain2.conf:
server {
ssl_certificate /etc/ssl/mail/cert.pem;
ssl_certificate_key /etc/ssl/mail/key.pem;
index index.php index.html;
client_max_body_size 0;
root /web;
include /etc/nginx/conf.d/listen_plain.active;
include /etc/nginx/conf.d/listen_ssl.active;
server_name mail.domain2.org;
server_tokens off;
location ^~ /.well-known/acme-challenge/ {
allow all;
default_type "text/plain";
}
location / {
return 301 https://mail.domain1.org;
}
}