I'm configuring an application that will authenticate a user, and then set the X-Accel-Redirect
header and a private api key, Foo
(for testing purposes), that will be passed on to the proxied endpoint.
I'm setting the private api key as a header in the authenticating application, and have the following location block in my nginx configuration file. How do I set the header to the proxied application based on what the upsteam server sets? I've also tried using $http_foo
and $sent_http_foo
. Currently, the Foo response header is never set for the proxy.
location ~* ^/redirect {
internal;
resolver 8.8.8.8;
proxy_ssl_server_name on;
add_header Foo $upstream_http_foo;
set $my_host "requestb.in";
set $my_uri "a_test_uri";
proxy_pass http://$my_host/$my_uri;
}