Hello, I’m trying to create a subdomain on my server but it’s not working. I have main domain where i host a wordpress also with Let’s Encrypt certificate, everything through tutorials on this site. My DNS is handled by CloudFlare.
So first i turned off CloudFlare services, now it handles only DNS. I also created a new A DNS record which points to the server IP.
Next i created a link of default server block in sites-enabled folder just to make sure everything is working and it is, when i enter IP of my server in browser, nginx welcome page appears. ( but I had to do it in another browser because chrome always translate ip to main domain name )
In the default server block, I changed server name to my subdomain ( something.something.com ) and when I restarted the nginx service a go to my subdomain it didn’t work, it redirected me to the main domain. So I was trying to solve this problem, I also removed my main domain from enabled sites and it still didn’t work.
But when I change the server name in default server block from subdomain to my main domain (main domain server block is disabled), it works (shows nginx welcome page).
What can be a problem?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
do you set cname on your cloudflare. or i think it might being issue of htaccess in wordpress
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.