Nginx headers to be set at the time of request processing

CeeGeeDev nginx-forum at
Mon Nov 28 23:56:29 UTC 2016

Francis Daly Wrote:
> On Wed, Nov 23, 2016 at 01:22:42PM -0500, Sushma wrote:
> Hi there,
> > I understand that proxy_set_header sets headers before proxying the
> > request to the upstream server.
> proxy_set_header adds extra http headers to the request that nginx
> sends to its upstream as part of the proxy_pass configuration.
> > Is there some way I can set the headers at the time of request
> > processing itself not just before proxying to upstream servers?
> I do not know what you mean by that question.
> What headers are you referring to, specifically?

CeeGeeDev wrote:
> To be clear, this is for a custom http module we wrote. We want it to
> know about request headers that we set in the nginx.conf (for
> proxy_pass etc). But it doesn't seem like the custom module receives
> the modified request headers. Is there any way to both a) set a
> request header for proxy_pass but also b) have custom http module
> code living inside the same nginx also process the request that has
> these alterations to the set of request headers?

So for the benefit of the community: our plan is to implement a custom
configuration directive in our http module to allow us to inform ourselves
about various header overrides made in the nginx configuration file that
should override various request headers in the actual request data
structures during request processing in our http module code (in our
business logic only... will have no effect on downstream request header
values). There seems to be no built-in alternative for nginx custom http
module developers (apologies if this question is better suited to the
development list), at least none that we can find documented anywhere.

Posted at Nginx Forum:,271147,271207#msg-271207

More information about the nginx mailing list