400 bad request errors

Igor Sysoev is at rambler-co.ru
Thu Oct 8 18:21:19 MSD 2009


On Thu, Oct 08, 2009 at 09:59:51AM -0400, pepejose wrote:

> cdan18po Wrote:
> -------------------------------------------------------
> > everything is now working verysmoothly
> > now...thanks for the great help you gave...
> > thanks
> 
> WTF?!
> 
> with this: 
> 
>     server {
> 	listen *:80;
>         server_name  _ "";  #default
>         return 444;
>     }
> 
> and "telnet host port" + "Ctrl-D"
> 
> I can not catch requests without host header
> 
> I also read this thread which speaks about http://marc.info/?l=nginx&m=121991334206140&w=2

'server_name  _ "";' does not make the server default.
You have to set default server for listen pair:

     server {
-  	listen *:80;
+  	listen *:80  default;
        server_name  _ "";
        return 444;
     }

However, if nginx has got empty request it will not run "return 444",
you will see 400 in access_log.


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





More information about the nginx mailing list