Hello Mailcow community,
I’m currently having an issue related to my Mailcow installation. I have the following DNS setup:
sub.domain.tld
is the designated subdomain for Mailcow (intended for email/webmail). This is what I gave as FQDN during the config script while installing.
domain.tld
is my main domain, and I do not want Mailcow to be accessible from this domain.
What works
Mailcow functions correctly on sub.domain.tld
inclusive but not limited to HTTP redirect to HTTPS, GUI, etc. All fine here.
DNS settings (A and AAAA records) for both sub.domain.tld
and domain.tld
are handled through Cloudflare.
What’s the Issue?
When I visit domain.tld
, I end up seeing the Mailcow instance, which I don’t want! I’ve specifically set Mailcow to handle only sub.domain.tld
, but it still shows up when accessing the main domain.
Additionally, domain.tld
does not use HTTPS (even when I try forcing HTTPS manually).
My Setup:
I followed the Mailcow installation guide , provided the correct FQDN (sub.domain.tld
) for mailcow.conf
during installation, and SSL works fine on sub.domain.tld
.
Here’s an overview of my relevant configuration files:
server_name.active
> server_name sub.domain.tld autodiscover.* autoconfig.* ;
I found that grep -r "server_name _;" /opt/mailcow-dockerized/data/conf/nginx/
returns:
/opt/mailcow-dockerized/data/conf/nginx/meta_exporter.conf: server_name _;
/opt/mailcow-dockerized/data/conf/nginx/dynmaps.conf: server_name _;
Both meta_exporter.conf
and dynmaps.conf
seem to use server_name _;
, which is likely catching requests to my main domain…
I’ve considered removing or restricting the server_name _
declarations, but I’m unsure of the best approach without potentially breaking something.
I don’t want Mailcow to appear on my main domain , nor do I want to set up a reverse proxy if I don’t have to.
If possible, I’d like domain.tld to do any of:
- Serve a simple 404/403 error or a placeholder page.
- Redirect to another site if easier.
I use the latest MailCow Dockerized (installed today) and otherwise things work smoothly (Other than awfully hit by google immediately with stuff like “this IP has a low reputation, we do not want your mail” lol.)
I appreciate any input, thanks!