Second subdomain NOT working

June 27, 2014 3.5k views

I used the wild card CNAME * @ DNS entry and my root and are accessible (on the same droplet). But if I try to access, after web server configuration, it takes me to
I’m using NginX server blocks and all domains are using the same IP address. (I’ve configured on 80 while I access/configure subs like and


My /etc/hosts:   localhost mydomain

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Hitting in the browser works fine but
hitting takes me to phpmyadmin login page.
Do I need to create A records for more than 1

4 Answers

No, the wildcard CNAME should be fine. There seems to be some other issue. Perhaps something like the host header not being properly retained. From the docs: Nginx checks

the header field “Host” to determine which server the request should be routed to. If its value does not match any server name, or the request does not contain this header field at all, then nginx will route the request to the default server for this port.

Did you edit /etc/nginx/fastcgi_params at all?

Thanks @astarr for replying.
I did not change fastcgi_params and I’m still trying to figure out the problem…

It might be easier to get a control panel to handle the virtual hosts.

These are some popular ones:

I’ve gotten subdomains to work in just a few minutes using Vesta CP, as long as the nameserver for your domain is set to use your server’s dns.

Thanks for the heads up.

I found in the error log that it couldn’t find the directory

After creating that directory, it’s working fine, phew.

Have another answer? Share your knowledge.