Hi all,
I’ve been trying my best to work this out myself but I’m coming up short on this one. I have a Ubuntu 16.04 Droplet that I’ve setup with LEMP and Wordpress. All of that is working fantastically. I can connect to it through my domain name and it all just works as it should.
What I want to do now setup a community page on my droplet. So at the moment I have my Wordpress site pointing to www.mydomain.com and I want to add a subdomain for a community page which is community.mydomain.com but I am unsure what is the best way to go about doing this.
Any help would be appreciated
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.
Hi!
You will need Nginx Server Blocks to make this possible You can learn more about Nginx Server Blocks in this DigitalOcean tutorial.
I will tl;dr part of this tutorial for you, but I recommend to read it so you learn more about it, it is excellent tutorial. :D
How you could do it: Let’s say you have two sites in: /var/www/example.com/html /var/www/community.example.com/html
You need to create server block for example.com and community.example.com. You can copy default Nginx server block and change it as you wish. Default server block is located under
/etc/nginx/sites-available/default
.This is how your server block for example.com should look:
This is how your server block for community.example.com should look:
After you config it don’t forget to enable you server blocks! Follow Step Four of given tutorial. Also you need to create appropriate DNS record for community web site. If your using DigitalOcean DNS management (Networking -> Domains under DigitalOcean Cloud Panel), you can just add CNAME record
community
pointing to@