add_header directive not working for 40x and 50x responses

agentzh agentzh at
Tue Nov 17 13:12:20 MSK 2009

On Mon, Oct 5, 2009 at 11:43 PM, fxdemolisher <nginx-forum at> wrote:
> As per the http header module's documentation (link) the add_header directive does not work for 40x and 50x error pages.

With the headers_more module ( ), it will by
default apply to all the status codes, including 4xx and 5xx.

> This is something that is required by my project since NGINX is responsible for serving error pages and we need to set specific cookies when the error page is displayed.

I'm not sure if you want to use nginx variables in your cookies. If
yes, then headers_more needs more work to make you happy :)


More information about the nginx mailing list