Welcome! Log In Create A New Profile

Advanced

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

Josh Stratton
February 04, 2014 09:33AM
Right, I actually have those lines commented out. That's the part I don't
understand. For example, if I put everything in the same file (example
below), neither one of them have a default_server or a wildcard. The only
other option I see from the link you sent me is www.morebears.com is
getting "defaulted" by nginx to the hostname. However, I don't know what
about my server would default to strattonbrazil.com. Based on the below
settings, I don't see how that should be happening and in my system
environment I don't see anything like `hostname` that would also direct to
strattonbrazil.com.

server {
listen 80;
#listen [::]:80 default_server ipv6only=on;

root /var/www/morebearsmore.com/public_html;
index index.html index.htm;
...
}

server {
listen 80;
#listen [::]:80 default_server ipv6only=on;

root /var/www/strattonbrazil.com/public_html;
index index.html index.htm;
...
}


On Mon, Feb 3, 2014 at 12:12 PM, Valentin V. Bartenev <vbart@nginx.com>wrote:

> On Monday 03 February 2014 11:48:41 Josh Stratton wrote:
> > > or to the first one in the configuration if there is no such
> > > parameter.
> >
> > As if all the server blocks are configured together? That sounds really
> > strange to me, that one server block could be the default for another
> > server block.
>
> They all are configured together since they share the same address:port
> pair.
> The only separation that server can make is based on requested host, but
> what
> if there is no matches among configured server names? Then nginx picks one
> based on a simple rule I already mentioned.
>
> And there is no magic in placing them in different configuration files (in
> fact,
> that "sites-available" thing is just a debian way of splitting web server
> configuration), they could be configured in one file as well.
>
>
> >
> > # rgrep default_server /etc/nginx/
> > /etc/nginx/sites-available/strattonbrazil.com: #listen [::]:80
> > default_server ipv6only=on;
> > /etc/nginx/sites-available/morebearsmore.com: #listen [::]:80
> > default_server ipv6only=on;
>
> Note, that you have "default_server" for IPv6 only, but your listen
> directives
> for IPv4 haven't got this parameter.
>
> wbr, Valentin V. Bartenev
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM

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

Josh Stratton February 04, 2014 09:33AM

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

Valentin V. Bartenev February 04, 2014 09:33AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 180
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready