Page 1 of 1

Only display site if alias exits when using catch all dns

Posted: Thu Jun 09, 2016 4:27 am
by delebash
I have a catch all dns entry for my domain in Digital Oceans domain control. CNAME * mydomain.com
So if I type test.mydomain.com it points to the same server.

This works fine but I only want to display test.mydomain.com if test is listed as an alias of mydomain.com in vestacp.

In the website for mydomain.com I have an alias test.mydomain.com so if I type in test.mydomain.com the catch all dns forwards to my server and is then directed to mydomain.com via the test alias I setup in vestacp for that domain.

However if I do not have test setup as an alias for mydomain.com then the dns server will still forward but the site should not load returning failed to connect since test is not listed as an alias of mydomain.com.

Thanks.

Re: Only display site if alias exits when using catch all dns

Posted: Tue Jun 21, 2016 4:17 am
by delebash
You can do *.domain.com for your server_name. Lookup wildcards for nginx server_name