Passing extra headers along with a X-Accel-Redirect

Maxim Dounin mdounin at
Sat Apr 5 15:52:39 MSD 2008


On Fri, Apr 04, 2008 at 02:16:29PM +0200, Joaquin Cuenca Abela wrote:

>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.

Maxim Dounin

More information about the nginx mailing list