Subdomains setup for Nginx

Posted December 15, 2013 7.9k views
Hi! I have a weird issue trying to configure my domain + subdomain web applications. DNS config: First virtual host config: Second virtual host config: and work as they are intended. However uses the same web application as two above. Why does is addressed to first virtual host?

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.

Submit an Answer
2 answers
On Ubuntu (not sure how it's done in CentOS), one would "activate" the subdomain by creating a symbolic link for the subdomain-config file in /etc/nginx/sites-enabled. Did you do the equivalent on your VPS?

Otherwise, you may want to check out How To Set Up nginx Virtual Hosts (Server Blocks) on CentOS 6.
by Etel Sverdlov
This tutorial shows you how to set up virtual hosts. Virtual Hosts are used to run more than one website or domain off of a single server and IP address. When used with nginx, virtual hosts are called Server Blocks. This tutorial covers setting up server blocks on a Centos server.
Yeah, the subsomain site was activated, but it had syntax error in it, that's why it didn't started.
Thank you for the help.