VestaCP stop a second domain loading pages from the first one

I am using vestacp on my droplet running Ubuntu. I have two domain names that I’ve configured in Vestacp. Each domain is configured with the following nameservers at the registrar: for >, for >,

I have created two DNS entries in VestaCP, both pointing to the single ip address asigned to the droplet. Both entries have template : child-ns. also has SSL certicate configured. does not have SSL.

Everything works perfect when accessing Everything works perfect when accessing

Let’s say I have a page on called mypage. The problem is, I can access that page through domain2 by adding https like so: (even though this page does not exist on domain2)

Google somehow noticed this and it’s now indexing pages from, under which I don’t want. What am I doing wrong? How can I stop this behaviour?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hey friend!

The best way is to enable SSL on both domain1 and domain2. Since VestaCP has LetsEncrypt built in, this should just be a check box away. If you have no SSL on domain2 then that means there is no matching virtual host for domain2 over port 443, causing requests to port 443 to default to the first available virtual host (which in this case is domain1).