Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to setup a subdomain in your nginx server

Lately I've created a sub-domain for one of my website. I hope you follow this blog on how to setup your nginx wordpress site. In the same server where I host my maindomain.com, I've added a subdomain.maindomain.com. And here is how:

  1. I created a new folder in /var/www/subdomain where I install a new copy of wordpress. Note that /var/www/html contains my maindomain.
  2. The duplicate the config site in the blog I mentioned above (my-site), so now I have subdomain ni /etc/nginx/sites-available.
  3. Make the following modifications (first 2 lines):
    listen 80;
    listen [::]:80;
    
  4. Basically, you can't have 2 virtual configurations with default_server marker.
  5. Your sub domain should now be accessible.
How to setup a subdomain in your nginx server How to setup a subdomain in your nginx server Reviewed by Edward Legaspi on Monday, November 02, 2015 Rating: 5

No comments:

Powered by Blogger.