Add_header doesn't work when 50x

Hi everybody,

I manage a server farm with more than 30+ servers using nginx.

Sometimes I forgot to start php-fpm, that is I got 502 BAD GATEWAY.

I have “add_header Host $hostname;” in my nginx.conf.

But this only enable when return code is 200 OK, there is no “Host”
Header in 502 BAD GATEWAY.

I cannot find which machine is wrong as soon as posible.

Is there any suggestion?

Thanks a lot.

Posted at Nginx Forum: