Default_server catch all block not working

lockev3.0 nginx-forum at nginx.us
Thu Mar 22 16:32:11 UTC 2012


At last I got it ! Well, to be honest I will say Maxim Dounim helped me
thru my logs. In the end it was so simple ::: My load balancer in front
of my Nginx's always looked thru IP so no host name ever matched any of
my server_name's. Solution simple :: Do the balancer refer to nodes thru
a locally resolved hostname also put as a new server_name.
...........simple like crazyness when it comes.

The thing now is I have following block and it works quite right. But If
I mean to use the commented return 444 instead of the rewrite ==> al my
web  start returning 503 !!! and nothing's functioning .......always the
strange things to me.

server {
        listen 80 default_server;
        server_name  _;
        error_log       /var/log/nginx/000default-error.log error;
        location / {
                proxy_set_header Host $host;
                rewrite .* http://somewherelse.net permanent;
                #return 444;
        }
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221572,224230#msg-224230



More information about the nginx mailing list