Welcome! Log In Create A New Profile

Advanced

x-accel-redirect to @location and empty $upstream_http_some_header

Руслан Закиров
November 14, 2016 06:14AM
Hi,

One URL redirects to @streams location:

HTTP/1.0 200 OK
expires: 0
cache-control: no-cache, no-store, must-revalidate
x-accel-redirect: @streams
Content-Type: text/html; charset=utf-8
Status: 200
x-real-location: /stream/?user_id=153847603&lang=RU
pragma: no-cache

@streams

Location looks like this:

location @streams {
proxy_set_header X-Real-IP $header_ip;
... more proxy sets...
proxy_set_header X-Y
ttt$upstream_http_x_real_location$upstream_http_status;
proxy_set_header X-Z ttt$http_x_real_location;
proxy_pass http://streams-backend$upstream_http_x_real_location;
}

However, $upstream_http_x_real_location variable is empty and request
reaches backed with original URL.

GET /core/user/stream/ HTTP/1.0
....
X-Y: ttt
X-Z: ttt


Tested with nginx 1.8.0 and 1.10.2 with the same outcome.

Is it a bug? Misconfiguration on my side? Any workarounds available?


--
Руслан Закиров
Руководитель отдела разработки веб-сервисов
+7(916) 597-92-69, ruz @ http://www.sports.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

x-accel-redirect to @location and empty $upstream_http_some_header

Руслан Закиров November 14, 2016 06:14AM

Re: x-accel-redirect to @location and empty $upstream_http_some_header

Maxim Dounin November 14, 2016 07:46AM

Re: x-accel-redirect to @location and empty $upstream_http_some_header

Руслан Закиров November 14, 2016 10:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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