By fsdolphin
Hi,
I’m currently trying to add a Server Block for one of my domains but for some reason it’s not working, it goes to the default block when viewed on a browser, this is what I did.
Pointed my domain to the name server from Digitalocean. NS1.DIGITALOCEAN.COM NS2…
Added the domain under the DNS menu in Digitalocean mysitename.com
Created a folder for my site in the /var/www folder. /var/www/mysitename
Created an index.html file inside the mysitename folder. /var/www/mysitename/index.html
Created the server block file. /etc/nginx/sites-available/mysitename.com
**mysitename.com block content: **
server {
listen 80;
listen [::]:80;
root /var/www/mysitename;
index index.html index.htm;
server_name mysitename.com www.mysitename.com;
location / {
try_files $uri $uri/ =404;
}
As you can see this is not set to be the default block but when I type mysitename.com it show the content from the block I have set as the default block.
Any idea what am I missing?
Thanks
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!
This question was answered by @ryanpq:
After enabling the server block did you restart your nginx server so it picked up the new configuration?
service nginx restart
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.