I have small problem with file download using X-Accel-Redirect. I am
using Nginx as proxy before some REST API application, some of the
requests are for big files which are located at other host - so I am
using X-Accel-Redirect to download them. But I have also some metadata
connected with file which I want to return in X-metadata header from
REST API.
I am using this trick with set to temporary variable and add_header
with this variable (which I’ve found somewhere on this list), but this
is not working. Even simple:
set $x_std “testest”;
add_header X-metadata $x_std;
does not work for me.
Could please somebody tell me what could be wrong?
Because you’re breaking the rewrite phase processing by issuing a
rewrite with a break. A break or return terminates the rewrite phase
so what you’re saying to Nginx is: rewrite and do no more rewrite
phase processing on this location.
The set directive is part of the rewrite module which means that it’s
processed during the rewrite phase. It’s not a bug, it’s the way it’s
supposed to be.
On Mon, Jun 06, 2011 at 03:15:05PM +0200, Kamil G. wrote:
Hi guys,
I have small problem with file download using X-Accel-Redirect. I am
using Nginx as proxy before some REST API application, some of the
requests are for big files which are located at other host - so I am
using X-Accel-Redirect to download them. But I have also some metadata
connected with file which I want to return in X-metadata header from
REST API.