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

Josh Stratton strattonbrazil at gmail.com
Mon Feb 3 19:48:41 UTC 2014


> 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.

# 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;


On Mon, Feb 3, 2014 at 11:43 AM, Valentin V. Bartenev <vbart at nginx.com>wrote:

> On Monday 03 February 2014 11:21:06 Josh Stratton wrote:
> > How long is that cache kept?
>
> It depends on browser if there were no cache-related headers in response.
>
> > If it redirected to the other one, will be redirect on my phone
> indefinitely?
> > I tried clearly my phone's settings and it still pulls up the other
> site's
> > page--the old page, too, as I've changed the words.  Is nginx saying this
> > page is cacheable and thus not returning the new version because the
> browser
> > uses the old one?
>
> By default nginx doesn't return any cache-related headers.  If the browser
> has
> cached some page, it can show the page to user without requesting server.
>
> >
> > > This article should shed the light:
> > > http://nginx.org/en/docs/http/server_names.html
> >
> > Thanks for the link.  That seems pretty clear, but how is nginx deriving
> > the hostname?  If I run `hostname` I get "home" back.  I still don't
> > understand why it fell back to the other one.
>
> If there is no server defined for a requested host, it falls back to that
> one
> with the "default_server" parameter in the listen directive for a specific
> address:port pair, or to the first one in the configuration if there is no
> such
> parameter.
>
>    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/78f76938/attachment.html>


More information about the nginx mailing list