Setting headers and cookies when proxying

Maxim Dounin mdounin at
Sat Aug 16 07:34:25 MSD 2008


On Fri, Aug 15, 2008 at 06:22:45PM -0700, Guy Naor wrote:

>I am trying to write a module that will insert a header into the request
>that is sent to the upstream servers (mongrels). I can set headers based on
>the code found in some other modules, but all set the header on the response
>headers, not the headers proxied forward. I also would like to set a cookie
>in the same form - add a cookie to the headers that will be passed to the
>upstream servers.
>Any ponters as to where to look for something like that? Or some other
>information that could help?

Um.  Just use proxy_set_header directive and allow user to 
configure it by hand (e.g. using variable from your module)?

You probably may modify r->headers_in too, but I'm not sure it's a 
good idea.

Maxim Dounin

More information about the nginx mailing list