As per the http header module’s documentation (link) the add_header
directive does not work for 40x and 50x error pages.
Is there a specific reason for this? Will the ability to use this
directive in error pages be added later on?
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.
There is also a post on the ruby nginx forums (link) with this issue
without a satisfactory answer.
Any information on the issue would be appreciated.
Posted at Nginx Forum:
Anyone know an answer to this at all?
Posted at Nginx Forum:
On Sat, Oct 10, 2009 at 2:12 AM, fxdemolisher [email protected]
wrote:
Anyone know an answer to this at all?
I’ll work on it in a headers-more module and/or provide a patch to add
an option to the standard headers module
Cheers,
-agentzh
On Mon, Oct 5, 2009 at 11:43 PM, fxdemolisher [email protected]
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 (
GitHub - openresty/headers-more-nginx-module: Set, add, and clear arbitrary output headers in NGINX http servers ), 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
Cheers,
-agentzh