Gathering upstream response headers

hi all

i need to gather all upstream response headers of a given special type
(e.g: “x_something”) in order to process them later. what would be the
best solution to achieve this in nginx (e.g via a custom module). the
problem here is that i have more than one upstream per single main
request. e.g via ssi or the ngx_echo module.

the “upstream_http_*” variables of the upstream module does this for
the last upstream, but i need to gather the headers at the end of the
main request. e.g in a location like this:

location = /test {
echo_location /sub1;
echo_location /sub2;
}

if sub1 gets a remote response header “x_something: 1” and sub2 gets a
response header “x_something: 2” i’d like to end up with a variable “1
2”. it would also be possible to use the ngx_memc module’s “append”
method to have all headers stored in memcacheed.

any clues

thanks in advance, bernd

Posted at Nginx Forum:

On Wed, Dec 23, 2009 at 2:24 PM, dobe [email protected] wrote:

hi all

i need to gather all upstream response headers of a given special type (e.g: “x_something”) in order to process them later. what would be the best solution to achieve this in nginx (e.g via a custom module). the problem here is that i have more than one upstream per single main request. e.g via ssi or the ngx_echo module.

You may find the following thread helpful:

http://forum.nginx.org/read.php?2,23767,24082

Good luck!
-agentzh