Inserting a Request header before proxying

Arvind Jayaprakash work at
Mon Oct 13 13:13:04 MSD 2008

How do I set dynamic values?
X-Foobar: <some_code_that_looks_at_request_and_generates_a_value>

Almir Karic wrote:
> On Sun, Oct 12, 2008 at 11:36:21PM -0700, work at wrote:
>> I'd like to insert a custom HTTP header (eg: X-foobar) into a request
>> before doing a proxy_pass.
>> Is there any way to do this without changing the proxy module itself? I
>> read that there can be only one handler per request. Though my module
>> retruns NGX_DECLINED after doing its job, it doesn't seem to get executed
>> first and proxy_pass seems to get invoked first.

More information about the nginx mailing list