10 messages in ru.sysoev.nginxRe: Empty server name argument - Can'...
FromSent OnAttachments
Luigi PerrotiAug 28, 2008 1:35 am 
Igor SysoevAug 28, 2008 1:56 am 
Luigi PerrotiAug 28, 2008 3:46 am 
Igor SysoevAug 28, 2008 3:48 am 
Luigi PerrotiAug 28, 2008 4:20 am 
Igor SysoevAug 28, 2008 4:33 am 
Luigi PerrotiAug 28, 2008 5:05 am 
Igor SysoevAug 28, 2008 5:16 am 
Luigi PerrotiAug 28, 2008 6:00 am 
Igor SysoevAug 28, 2008 6:05 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Empty server name argument - Can't get it to workActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Aug 28, 2008 1:56:55 am
List:ru.sysoev.nginx

On Thu, Aug 28, 2008 at 08:36:19AM +0000, Luigi Perroti wrote:

I'm trying out the new 0.7.13 release which permits to use "" as server name, but there must be something wrong with my configuration since I can't get this new feature to work.

Here's the relevant snippet from my configuration file:

http { access_log off; recursive_error_pages off; server { listen 123.123.123.123:80; server_name _ ""; error_page 400 /400.html; location /400.html { internal; if ($host = "") { access_log /var/log/access.log; } } location / { fastcgi_pass 127.0.0.1:1234; fastcgi_intercept_errors on; } } }

I thought that with this configuration I'd be able to: - have the application behind the fastcgi server receive requests with no Host: header specified. - log into access.log when my custom 400 error page is served, but only if no Host: header is present.

Instead the behaviour I'm observing is that when nginx receives a request without the Host: header my custom 400 page gets served without sending the request to the fastcgi server and nothing is logged into access.log either.

$host is this case is "_", server_name. You should use $http_host.