Welcome! Log In Create A New Profile

Advanced

Is it possible to get headers from X-Accel-Redirect reply

mayamatakeshi
November 27, 2015 07:20PM
Hello, my upstream server replies with this:

HTTP/1.1 200 OK.
Server: test.
Date: Sat, 28 Nov 2015 00:05:55 GMT.
Content-Type: application/json.
Content-Length: 0.
Connection: close.
X-ExtraInfo: domain_name=test1.com
;domain_id=1000;user_name=user1;user_id=10001001.
X-Accel-Redirect: /internal_redirect/192.168.2.153:7777.
Access-Control-Allow-Origin: https://192.168.2.153:445.
Access-Control-Allow-Credentials: true.

which I handle with this:

location ~ ^/internal_redirect/(.*) {
internal;
proxy_pass http://$1$is_args$args;
}

However, I want to pass X-ExtraInfo to the target upstream server so i
tried:
proxy_set_header X-ExtraInfo
$sent_http_x_extrainfo;
and even:
proxy_set_header X-ExtraInfo
$http_x_extrainfo;
but none of them worked.
So, is there a way to get headers from X-Accel-Redirect replies?

Obs: I can workaround this passing the ExtraInfo as arguments in the target
URL but I want try to rely on the current interface of the target upstream
server.

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

Is it possible to get headers from X-Accel-Redirect reply

mayamatakeshi November 27, 2015 07:20PM

Re: Is it possible to get headers from X-Accel-Redirect reply

mayamatakeshi November 27, 2015 08:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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