Welcome! Log In Create A New Profile

Advanced

Re: Logging header values from the first upstream

Maxim Dounin
October 10, 2013 06:58PM
Hello!

On Fri, Oct 11, 2013 at 12:27:34AM +0200, Matt Spitz wrote:

> The HttpUpstreamModule states that variable values for
> $upstream_http_$HEADER are only valid for the last upstream accessed
> during a request. I'd like to know if there's a workaround.

[...]

The $upstream_* variables are cleared once nginx starts to work
with a new upstream. If you want to preserve values before
X-Accel-Redirect, you may do so by using "set" in a destination
location of X-Accel-Redirect (this works as rewrite directives are
executed before upstream data is re-initialized). E.g.:

location /api/ {
proxy_pass ...
}

location /internal/ {
set $previous_upstream_http_foo $upstream_http_foo;
proxy_pass ...
}

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Logging header values from the first upstream

Matt Spitz October 10, 2013 06:28PM

Re: Logging header values from the first upstream

Maxim Dounin October 10, 2013 06:58PM

Re: Logging header values from the first upstream

Matt Spitz October 10, 2013 11:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 150
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