atom feed11 messages in ru.sysoev.nginxRe: Issue with upstream
FromSent OnAttachments
Phil BayfieldNov 16, 2010 5:16 am 
Phil BayfieldNov 16, 2010 6:27 am 
Maxim DouninNov 16, 2010 6:48 am.txt
Phil BayfieldNov 16, 2010 7:01 am 
Maxim DouninNov 16, 2010 10:24 am 
António P. P. AlmeidaNov 16, 2010 10:31 am 
Maxim DouninNov 16, 2010 11:01 am 
Phil BayfieldNov 16, 2010 12:14 pm 
Maxim DouninNov 16, 2010 12:32 pm 
Phil BayfieldNov 17, 2010 4:36 am 
Maxim DouninJan 5, 2011 11:59 pm.txt
Subject:Re: Issue with upstream
From:Maxim Dounin (mdou@mdounin.ru)
Date:Nov 16, 2010 11:01:43 am
List:ru.sysoev.nginx

Hello!

On Tue, Nov 16, 2010 at 06:32:19PM +0000, António P. P. Almeida wrote:

On 16 Nov 2010 18h24 WET, mdou@mdounin.ru wrote:

Hello!

On Tue, Nov 16, 2010 at 03:02:00PM +0000, Phil Bayfield wrote:

I had actually prefixed upstream and localhost 000 and everything else 100 to force them to load in the correct order. On 1 particular domain it would throw that error unless it was loaded last, hence just giving it a prefix 101 solved the issue. Bit strange!

Addition prefixes isn't going to do anything good as nginx doesn't sort included files (I assume you used something like "include /path/*.conf") and they are loaded in unspecified order (as filesystem returns them).

You have to manually preserve correct order, i.e. use something like

include /path/to/generic/includes/*.conf; include /path/to/virtual/hosts/*.conf;

Well that's interesting. I was under the (wrong) impression that in fact it operated like in Apache. Where there's a 000-default vhost config file in Debian that is a symlink created when enabling the site.

I have a 000-default file that just returns a 444 when the Host header doesn't match any of the server_name directives. I guess that I should be loading that file explicitly before all other.

include /etc/nginx/sites-enabled/000-default include /etc/nginx/sites-enabled/[a-z]*

Right?

Alternative solution is to use "listen ... default;" (or "listen ... default_server;" which is the same) in a server which should be default on a given socket.

http://nginx.org/en/docs/http/request_processing.html#how_to_prevent_undefined_server_names