<div dir="ltr">I've followed the tutorial below to setup a couple of server blocks, but I get the "Welcome to nginx" message every time. <div><br></div><div><a href="https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3">https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3</a><br>
</div><div><br></div><div><div>$ ls -l /etc/nginx/sites-available/<br></div></div><div><div>total 8</div><div>-rw-r--r-- 1 root root 1185 Feb 2 17:01 <a href="http://morebearsmore.com">morebearsmore.com</a></div><div>-rw-r--r-- 1 root root 2744 Feb 2 17:07 <a href="http://strattonbrazil.com">strattonbrazil.com</a></div>
</div><div><br></div><div><div>$ ls -l /etc/nginx/sites-enabled/</div><div>total 0</div><div>lrwxrwxrwx 1 root root 44 Feb 2 17:03 <a href="http://morebearsmore.com">morebearsmore.com</a> -> /etc/nginx/sites-available/<a href="http://morebearsmore.com">morebearsmore.com</a></div>
<div>lrwxrwxrwx 1 root root 45 Feb 2 16:44 <a href="http://strattonbrazil.com">strattonbrazil.com</a> -> /etc/nginx/sites-available/<a href="http://strattonbrazil.com">strattonbrazil.com</a></div></div><div><br></div>
<div>This is the contents of more of the configs (minus the comments at the top). </div><div><br></div><div><div>server {</div><div><span class="" style="white-space:pre"> </span>listen 80;</div><div><span class="" style="white-space:pre"> </span>listen [::]:80 default_server ipv6only=on;</div>
<div><br></div><div> <span class="" style="white-space:pre"> </span>root /var/www/<a href="http://morebearsmore.com/public_html">morebearsmore.com/public_html</a>;</div><div><span class="" style="white-space:pre"> </span>index index.html index.htm;</div>
<div><br></div><div><br></div><div><span class="" style="white-space:pre"> </span># Make site accessible from <a href="http://localhost/">http://localhost/</a></div><div><span class="" style="white-space:pre"> </span>server_name <a href="http://morebearsmore.com">morebearsmore.com</a>;</div>
<div><br></div><div><span class="" style="white-space:pre"> </span>location / {</div><div><span class="" style="white-space:pre"> </span># First attempt to serve request as file, then</div><div><span class="" style="white-space:pre"> </span># as directory, then fall back to displaying a 404.</div>
<div><span class="" style="white-space:pre"> </span>try_files $uri $uri/ /index.html;</div><div><span class="" style="white-space:pre"> </span># Uncomment to enable naxsi on this location</div><div><span class="" style="white-space:pre"> </span># include /etc/nginx/naxsi.rules</div>
<div><span class="" style="white-space:pre"> </span>}</div><div><br></div><div><span class="" style="white-space:pre"> </span>location /doc/ {</div><div><span class="" style="white-space:pre"> </span>alias /usr/share/doc/;</div>
<div><span class="" style="white-space:pre"> </span>autoindex on;</div><div><span class="" style="white-space:pre"> </span>allow 127.0.0.1;</div><div><span class="" style="white-space:pre"> </span>allow ::1;</div><div>
<span class="" style="white-space:pre"> </span>deny all;</div><div><span class="" style="white-space:pre"> </span>}</div><div><br></div><div>}</div></div><div><br></div><div>I've added a "hello world" index file to that directory, too. </div>
<div><br></div><div><div>$ ls -l /var/www/<a href="http://strattonbrazil.com/public_html/index.html">strattonbrazil.com/public_html/index.html</a> </div><div>-rw-r--r-- 1 root root 148 Feb 2 16:41 /var/www/<a href="http://strattonbrazil.com/public_html/index.html">strattonbrazil.com/public_html/index.html</a></div>
</div><div><br></div><div><div>$ cat /var/www/<a href="http://strattonbrazil.com/public_html/index.html">strattonbrazil.com/public_html/index.html</a> </div><div><html></div><div> <head></div><div> <title><a href="http://www.strattonbrazil.com">www.strattonbrazil.com</a></title></div>
<div> </head></div><div> <body></div><div> <h1>Success: You Have Set Up a Virtual Host</h1></div><div> </body></div><div></html></div></div><div><br></div><div>But again every time I get the same welcome message. Here's the access log for hitting <a href="http://morebearsmore.com">morebearsmore.com</a> a few times from my web browser. I don't see any messages in the error log. </div>
<div><br></div><div><div>71.217.116.55 - - [02/Feb/2014:17:13:57 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36"</div>
<div>71.217.116.55 - - [02/Feb/2014:17:14:00 +0000] "-" 400 0 "-" "-"</div><div>71.217.116.55 - - [02/Feb/2014:17:14:07 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36"</div>
</div><div><br></div></div>