Welcome! Log In Create A New Profile

Advanced

Re: Questions for X-Accel-Redirect

December 21, 2014 08:00PM
Hi,

On 2014/12/19 21:10, Maxim Dounin wrote:
> Hello!
>
> On Fri, Dec 19, 2014 at 03:52:55PM +0900, Toshikuni Fukaya wrote:
>
>> Hi,
>>
>> I have some questions for X-Accel-Redirect.
>>
>> Background: I use X-Accel-Redirect to send blob data from a second
>> server (:8001 in below). I want to send headers from not only the second
>> but also the first (:8000).
>> Current nginx implementation, however, sends only headers from the
>> second except some headers from the first, such as Content-Type.
>>
>> Question 1:
>> Can I change this behavior to send headers from the first server
>> together with ones from the second to a client?
>
> You can save headers from the first server response from
> $upstream_http_* variables and then use add_header to add them to
> the final response:
>
> location / {
> proxy_pass http://upstream1;
> }
>
> location /second/ {
> set $x_foo_bar $upstream_http_x_foo_bar;
> add_header X-Foo-Bar $x_foo_bar;
> proxy_pass http://upstream2;
> }
>
> I don't really think we need additional functionality here.
>

It is hard for me because I want to redirect almost all headers from the
first server to a client.
Following your suggestion, I need too many set and add_header directives.

Thanks,
Toshikuni Fukaya

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

Questions for X-Accel-Redirect

Toshikuni Fukaya 840 December 19, 2014 01:54AM

Re: Questions for X-Accel-Redirect

Maxim Dounin 352 December 19, 2014 07:12AM

Re: Questions for X-Accel-Redirect

Toshikuni Fukaya 326 December 21, 2014 08:00PM

Re: Questions for X-Accel-Redirect

steveh 514 December 21, 2014 08:04PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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