Empty server name argument - Can't get it to work

Igor Sysoev is at rambler-co.ru
Thu Aug 28 15:33:23 MSD 2008


On Thu, Aug 28, 2008 at 01:21:04PM +0200, Luigi Perroti wrote:

> On 8/28/08, Igor Sysoev <is at rambler-co.ru> wrote:
> 
> > 2) or any successfull AND 400 requets without Host header ?
> 
> I would like to do exactly that, is it possible?

Try the following:

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 ($http_host) {
         break;
      }

      fastcgi_pass   127.0.0.1:1234;
      access_log /var/log/access.log;
    }

    location / {
      fastcgi_pass   127.0.0.1:1234;
      fastcgi_intercept_errors on;
    }
  }
}


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list