Default_server catch all block not working
Jonathan Matthews
contact at jpluscplusm.com
Wed Mar 28 16:10:59 UTC 2012
On 22 March 2012 16:32, lockev3.0 <nginx-forum at nginx.us> wrote:
> 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;
> }
> }
Er, WTF?
You use the non-standard 444 ("444 closes the connection without
sending any headers") and you expect your downstream to do something
with that *other* than correctly respond to requests with a 503
Service Unavailable?
What you describe is *exactly* what I'd expect to see.
Either your understanding/expectations are faulty, or you haven't
explained yourself correctly.
Jonathan
More information about the nginx
mailing list