What I need to change if I want to open my site with www. or without www?

November 27, 2015 444 views
Nginx DigitalOcean DNS Arch Linux

I have few site on digitalocean server but some of my sites open with www. and some of without www. . I just want If open my site with both ways like this example

Right now www. is not working and its take me to "Welcome to nginx" page

1 comment
  • Can you post a snippet of your Nginx configuration? It would make it easier to find the issue.

    Generally, if you want both www and non-www URLs to display the same content, in your server block you just need to set the server_name directive to have both:

    server {
        listen       80;
        # And so on...
Be the first one to answer this question.