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

Руслан Закиров ruz at sports.ru
Mon Nov 14 11:13:18 UTC 2016


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/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20161114/63906453/attachment.html>


More information about the nginx mailing list