<div dir="ltr">That's strange.  It only fixed it on my desktop.  It still goes to the <a href="http://strattonbrazil.com">strattonbrazil.com</a> site when I type in <a href="http://www.morebearsmore.com">www.morebearsmore.com</a> on my phone, which was the original problem.  Is the phone doing some kind of caching?  Why would this happen on a windows phone and iphone with nginx (and apache when I tried it) but not my desktop?  </div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 10:52 AM, Josh Stratton <span dir="ltr"><<a href="mailto:strattonbrazil@gmail.com" target="_blank">strattonbrazil@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Nevermind.  I found the answer here that fixed it.  I'm redirecting from www now.  Still don't understand why it fell back to the other server block.  <div>

<br></div><div><a href="http://stackoverflow.com/questions/9951827/www-in-domain-not-working-in-nginx" target="_blank">http://stackoverflow.com/questions/9951827/www-in-domain-not-working-in-nginx</a><br>
</div><div><br></div><div><div>server {</div><div>    server_name <a href="http://www.morebearsmore.com" target="_blank">www.morebearsmore.com</a>;</div><div>    return 301 <a href="http://morebearsmore.com" target="_blank">http://morebearsmore.com</a>$request_uri;</div>


<div>}</div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 10:42 AM, Josh Stratton <span dir="ltr"><<a href="mailto:strattonbrazil@gmail.com" target="_blank">strattonbrazil@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think I have everything working as expected.  The only thing that's still strange to me is when I go to the <a href="http://morebearsmore.com" target="_blank">morebearsmore.com</a> domain with "www" prefixed to it, it goes to the test html file in the other server block.  I had this problem in apache, so I switched to nginx and I'm still seeing it.  I tried to setup both server blocks at the same time.  Why would <a href="http://www.morebearsmore.com" target="_blank">www.morebearsmore.com</a> go to my <a href="http://strattonbrazil.com" target="_blank">strattonbrazil.com</a> directory while the other <a href="http://morebearsmore.com" target="_blank">morebearsmore.com</a> goes to the correct directory?  I figured with a fresh install of nginx, I would see it "default" to one or the other.  Is <a href="http://strattonbrazil.com" target="_blank">strattonbrazil.com</a> just happening to be the fallback?  </div>


<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 9:13 AM, Josh Stratton <span dir="ltr"><<a href="mailto:strattonbrazil@gmail.com" target="_blank">strattonbrazil@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This is my nginx.conf page, which I haven't done anything with.  The /etc/nginx/conf.d/ directory on my machine is empty.  </div>



<div><br></div><div>user www-data;</div><div>worker_processes 4;</div>
<div>pid /run/nginx.pid;</div><div><br></div><div>events {</div><div><span style="white-space:pre-wrap">        </span>worker_connections 768;</div><div><span style="white-space:pre-wrap">  </span># multi_accept on;</div>
<div>}</div><div><br></div><div>http {</div><div><br></div><div><span style="white-space:pre-wrap">   </span>##</div><div><span style="white-space:pre-wrap">       </span># Basic Settings</div><div><span style="white-space:pre-wrap"> </span>##</div>




<div><br></div><div><span style="white-space:pre-wrap"> </span>sendfile on;</div><div><span style="white-space:pre-wrap">     </span>tcp_nopush on;</div><div><span style="white-space:pre-wrap">   </span>tcp_nodelay on;</div>
<div><span style="white-space:pre-wrap">  </span>keepalive_timeout 65;</div><div><span style="white-space:pre-wrap">    </span>types_hash_max_size 2048;</div><div><span style="white-space:pre-wrap">        </span># server_tokens off;</div>




<div><br></div><div><span style="white-space:pre-wrap"> </span># server_names_hash_bucket_size 64;</div><div><span style="white-space:pre-wrap">      </span># server_name_in_redirect off;</div><div><br></div><div><span style="white-space:pre-wrap">  </span>include /etc/nginx/mime.types;</div>




<div><span style="white-space:pre-wrap">  </span>default_type application/octet-stream;</div><div><br></div><div><span style="white-space:pre-wrap">  </span>##</div><div><span style="white-space:pre-wrap">       </span># Logging Settings</div>




<div><span style="white-space:pre-wrap">  </span>##</div><div><br></div><div><span style="white-space:pre-wrap">      </span>access_log /var/log/nginx/access.log;</div><div><span style="white-space:pre-wrap">    </span>error_log /var/log/nginx/error.log;</div>




<div><br></div><div><span style="white-space:pre-wrap"> </span>##</div><div><span style="white-space:pre-wrap">       </span># Gzip Settings</div><div><span style="white-space:pre-wrap">  </span>##</div><div><br></div>
<div><span style="white-space:pre-wrap">  </span>gzip on;</div><div><span style="white-space:pre-wrap"> </span>gzip_disable "msie6";</div><div><br></div><div><span style="white-space:pre-wrap"> </span># gzip_vary on;</div>




<div><span style="white-space:pre-wrap">  </span># gzip_proxied any;</div><div><span style="white-space:pre-wrap">      </span># gzip_comp_level 6;</div><div><span style="white-space:pre-wrap">     </span># gzip_buffers 16 8k;</div>




<div><span style="white-space:pre-wrap">  </span># gzip_http_version 1.1;</div><div><span style="white-space:pre-wrap"> </span># gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;</div>




<div><br></div><div><span style="white-space:pre-wrap"> </span>##</div><div><span style="white-space:pre-wrap">       </span># nginx-naxsi config</div><div><span style="white-space:pre-wrap">     </span>##</div><div><span style="white-space:pre-wrap">       </span># Uncomment it if you installed nginx-naxsi</div>




<div><span style="white-space:pre-wrap">  </span>##</div><div><br></div><div><span style="white-space:pre-wrap">      </span>#include /etc/nginx/naxsi_core.rules;</div><div><br></div><div><span style="white-space:pre-wrap">   </span>##</div>




<div><span style="white-space:pre-wrap">  </span># nginx-passenger config</div><div><span style="white-space:pre-wrap"> </span>##</div><div><span style="white-space:pre-wrap">       </span># Uncomment it if you installed nginx-passenger</div>




<div><span style="white-space:pre-wrap">  </span>##</div><div><span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap"> </span>#passenger_root /usr;</div><div><span style="white-space:pre-wrap">    </span>#passenger_ruby /usr/bin/ruby;</div>




<div><br></div><div><span style="white-space:pre-wrap"> </span>##</div><div><span style="white-space:pre-wrap">       </span># Virtual Host Configs</div><div><span style="white-space:pre-wrap">   </span>##</div><div><br>
</div><div><span style="white-space:pre-wrap">      </span>include /etc/nginx/conf.d/*.conf;</div><div><span style="white-space:pre-wrap">        </span>include /etc/nginx/sites-enabled/*;</div><div>}</div><div><br></div></div><div>



<div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 8:53 AM, Valentin V. Bartenev <span dir="ltr"><<a href="mailto:vbart@nginx.com" target="_blank">vbart@nginx.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Sunday 02 February 2014 09:14:03 Josh Stratton wrote:<br>
> I've followed the tutorial below to setup a couple of server blocks, but I<br>
> get the "Welcome to nginx" message every time.<br>
><br>
> <a href="https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3" target="_blank">https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3</a><br>





><br>
> $ ls -l /etc/nginx/sites-available/<br>
> total 8<br>
> -rw-r--r-- 1 root root 1185 Feb  2 17:01 <a href="http://morebearsmore.com" target="_blank">morebearsmore.com</a><br>
> -rw-r--r-- 1 root root 2744 Feb  2 17:07 <a href="http://strattonbrazil.com" target="_blank">strattonbrazil.com</a><br>
><br>
> $ ls -l /etc/nginx/sites-enabled/<br>
> total 0<br>
> lrwxrwxrwx 1 root root 44 Feb  2 17:03 <a href="http://morebearsmore.com" target="_blank">morebearsmore.com</a> -><br>
> /etc/nginx/sites-available/<a href="http://morebearsmore.com" target="_blank">morebearsmore.com</a><br>
> lrwxrwxrwx 1 root root 45 Feb  2 16:44 <a href="http://strattonbrazil.com" target="_blank">strattonbrazil.com</a> -><br>
> /etc/nginx/sites-available/<a href="http://strattonbrazil.com" target="_blank">strattonbrazil.com</a><br>
><br>
> This is the contents of more of the configs (minus the comments at the<br>
> top).<br>
</div>[..]<br>
<br>
What's in your nginx.conf?<br>
<br>
  wbr, Valentin V. Bartenev<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>