Passing extra headers along with a X-Accel-Redirect

Joaquin Cuenca Abela e98cuenc at
Fri Apr 11 00:49:26 MSD 2008


On Sat, Apr 5, 2008 at 1:52 PM, Maxim Dounin <mdounin at> wrote:
> Hello!
> On Fri, Apr 04, 2008 at 02:16:29PM +0200, Joaquin Cuenca Abela wrote:
> > Hi,
> >
> > I have a backend in PHP that is using X-Accel-Redirect to make nginx
> > send a file. Along with that file, I have to set up some headers, with
> > content that will be decided by the PHP backend. If I just add a
> > header in PHP, nginx eats it. Is there anyway to pass an extra header
> > from PHP to the end client?
> >
> With X-Accel-Redirect only several hardcoded headers are passed to client from original response (i.e. one which returned X-Accel-Redirect). Full list (see ngx_http_upstream.c):
> "Content-Type", "Set-Cookie", "Content-Disposition", "Cache-Control", "Expires", "Accept-Ranges"
> The only way to change this list now is to patch sources.

Fair enough. Any idea for the rationale of this? I think it makes more
sense to just blindly copy all the headers from the original response.


Joaquin Cuenca Abela

More information about the nginx mailing list