I have one proxy that is handling Authorization of users for media
content. This proxy really does authorize users, returning 403 if they
are not permitted to access a resource. Then I proxy to amazon s3 to a
private bucket. In order to authenticate myself I need to pass an
Authorization header to amazon s3. The name of the header is misleading
because really this is authentication. Is there any way to return that
header in the response from first proxy while returning X-Accel-Redirect
and have it passed to the second proxy?
I’ve tried setting Authorization in my first proxy and then setting
proxy_pass_header Authorization in the location of the second proxy but
it is never passed. Is there any way to do this?
As a hack I’ve successfully set a query argument in X-Accel-Redirect
that I then extract and use to set the Authorization header. This
doesn’t seem right but its working for some reason.
Posted at Nginx Forum: