0

Hi I'm pretty new to servers so I'm following the digital ocean guides of setting it up from 0 to node.js. (somestring replaces the actual first part of the url here just to be safe.)

I have added my url to /etc/nginx/sites-available/somestring.online-server.cloud/html

and this as the content:

server {
        listen 80;
        listen [::]:80;

        root /var/www/somestring.online-server.cloud/html;
        index index.html index.htm index.nginx-debian.html;

        server_name somestring.online-server.cloud www.somestring.online-server.cloud;

        location / {
                try_files $uri $uri/ =404;
        }
}

the first url works with http://somestring.online-server.cloud but the second with www does not resolve. this throws errors so i'd like to fix it. Could this be a limitation of the hosting provider (ionos / 1&1), or did i miss something?

Oddly enough there is a question that is the exact opposite where www works but http doesn't.

nomadDev
  • 23
  • 2
  • 8

1 Answers1

0

Check these answers, It should help

Subdomains not working when www is added?

https://www.digitalocean.com/community/questions/how-to-configure-subdomains-to-use-www-and-non-www

Punith B M
  • 39
  • 1
  • 12