server blocks configured, but getting "hello world" of nginx

Josh Stratton strattonbrazil at gmail.com
Mon Feb 3 18:55:22 UTC 2014


That's strange.  It only fixed it on my desktop.  It still goes to the
strattonbrazil.com site when I type in www.morebearsmore.com 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?


On Mon, Feb 3, 2014 at 10:52 AM, Josh Stratton <strattonbrazil at gmail.com>wrote:

> 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.
>
>
> http://stackoverflow.com/questions/9951827/www-in-domain-not-working-in-nginx
>
> server {
>     server_name www.morebearsmore.com;
>     return 301 http://morebearsmore.com$request_uri;
> }
>
>
>
> On Mon, Feb 3, 2014 at 10:42 AM, Josh Stratton <strattonbrazil at gmail.com>wrote:
>
>> I think I have everything working as expected.  The only thing that's
>> still strange to me is when I go to the morebearsmore.com 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 www.morebearsmore.com go to my strattonbrazil.com directory while
>> the other morebearsmore.com goes to the correct directory?  I figured
>> with a fresh install of nginx, I would see it "default" to one or the
>> other.  Is strattonbrazil.com just happening to be the fallback?
>>
>>
>> On Mon, Feb 3, 2014 at 9:13 AM, Josh Stratton <strattonbrazil at gmail.com>wrote:
>>
>>> This is my nginx.conf page, which I haven't done anything with.  The
>>> /etc/nginx/conf.d/ directory on my machine is empty.
>>>
>>> user www-data;
>>> worker_processes 4;
>>> pid /run/nginx.pid;
>>>
>>> events {
>>> worker_connections 768;
>>> # multi_accept on;
>>> }
>>>
>>> http {
>>>
>>> ##
>>> # Basic Settings
>>> ##
>>>
>>> sendfile on;
>>> tcp_nopush on;
>>> tcp_nodelay on;
>>>  keepalive_timeout 65;
>>> types_hash_max_size 2048;
>>> # server_tokens off;
>>>
>>> # server_names_hash_bucket_size 64;
>>> # server_name_in_redirect off;
>>>
>>> include /etc/nginx/mime.types;
>>>  default_type application/octet-stream;
>>>
>>> ##
>>> # Logging Settings
>>>  ##
>>>
>>> access_log /var/log/nginx/access.log;
>>> error_log /var/log/nginx/error.log;
>>>
>>> ##
>>> # Gzip Settings
>>> ##
>>>
>>>  gzip on;
>>> gzip_disable "msie6";
>>>
>>> # gzip_vary on;
>>>  # gzip_proxied any;
>>> # gzip_comp_level 6;
>>> # gzip_buffers 16 8k;
>>>  # gzip_http_version 1.1;
>>> # gzip_types text/plain text/css application/json
>>> application/x-javascript text/xml application/xml application/xml+rss
>>> text/javascript;
>>>
>>> ##
>>> # nginx-naxsi config
>>> ##
>>> # Uncomment it if you installed nginx-naxsi
>>>  ##
>>>
>>> #include /etc/nginx/naxsi_core.rules;
>>>
>>> ##
>>>  # nginx-passenger config
>>> ##
>>> # Uncomment it if you installed nginx-passenger
>>>  ##
>>>  #passenger_root /usr;
>>> #passenger_ruby /usr/bin/ruby;
>>>
>>> ##
>>> # Virtual Host Configs
>>> ##
>>>
>>>  include /etc/nginx/conf.d/*.conf;
>>> include /etc/nginx/sites-enabled/*;
>>> }
>>>
>>>
>>>
>>> On Mon, Feb 3, 2014 at 8:53 AM, Valentin V. Bartenev <vbart at nginx.com>wrote:
>>>
>>>> On Sunday 02 February 2014 09:14:03 Josh Stratton wrote:
>>>> > I've followed the tutorial below to setup a couple of server blocks,
>>>> but I
>>>> > get the "Welcome to nginx" message every time.
>>>> >
>>>> >
>>>> https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
>>>> >
>>>> > $ ls -l /etc/nginx/sites-available/
>>>> > total 8
>>>> > -rw-r--r-- 1 root root 1185 Feb  2 17:01 morebearsmore.com
>>>> > -rw-r--r-- 1 root root 2744 Feb  2 17:07 strattonbrazil.com
>>>> >
>>>> > $ ls -l /etc/nginx/sites-enabled/
>>>> > total 0
>>>> > lrwxrwxrwx 1 root root 44 Feb  2 17:03 morebearsmore.com ->
>>>> > /etc/nginx/sites-available/morebearsmore.com
>>>> > lrwxrwxrwx 1 root root 45 Feb  2 16:44 strattonbrazil.com ->
>>>> > /etc/nginx/sites-available/strattonbrazil.com
>>>> >
>>>> > This is the contents of more of the configs (minus the comments at the
>>>> > top).
>>>> [..]
>>>>
>>>> What's in your nginx.conf?
>>>>
>>>>   wbr, Valentin V. Bartenev
>>>>
>>>> _______________________________________________
>>>> nginx mailing list
>>>> nginx at nginx.org
>>>> http://mailman.nginx.org/mailman/listinfo/nginx
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140203/04e3e5db/attachment-0001.html>


More information about the nginx mailing list