Welcome! Log In Create A New Profile

Advanced

proxy_set_header variable evaluation

August 26, 2009 02:34PM
I am trying to do some tricks with upstream+proxy and ran into what
seems like a limitation of the proxy_set_header feature.

When an upstream's response triggers resending the request to the next
upsteam, I was hoping $upstream_response_time is available with data of
what happened in the previous upsteams. I'm trying to pass it using the
following directive:

proxy_set_header X-retry1 $upstream_response_time;

It looks like the variable is always unavailable (even when when nginx
tries to access the second upstream for the same request). However, the
value seems to be available during the logging phase.

I tried recompiling with the response variable marked as uncachable (v->no_cacheable = 1) but that did not seem to help.

The question is if this is a limitation of proxy_set_header or upstream
variables? I got a feeling that $upstream_response_time is evaluated
once before the upstreams are tried and evalutes to "not found" and not
re-evaluated for each upstream attempt.
Subject Author Posted

proxy_set_header variable evaluation

anomalizer August 26, 2009 02:34PM

Re: proxy_set_header variable evaluation

Maxim Dounin August 26, 2009 03:19PM

Re: proxy_set_header variable evaluation

Arvind Jayaprakash August 27, 2009 12:34AM

Re: proxy_set_header variable evaluation

Maxim Dounin August 27, 2009 04:47AM

Re: proxy_set_header variable evaluation

Arvind Jayaprakash September 02, 2009 05:49PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 315
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready