X-Accel-Redirect to proxy_pass

Igor Sysoev is at rambler-co.ru
Tue Aug 12 18:54:21 MSD 2008


On Tue, Aug 12, 2008 at 11:30:33PM +0900, Daniel wrote:

> I have 1 proxy and 2 group of web servers; the first group are the
> application servers and the second group are the file storage servers
> I'm trying to set the proxy in a way that the app servers send a
> 'X-Accel-Redirect' header with the filepath of a file in the storage
> servers without luck.
> 
> the app server send the header:
> down.php
> <?php
> header('X-Accel-Redirect: /store/data/mass4.txt');
> ?>
> 
> the conf in the proxy is:
> location /store/ {
> internal;
> proxy_pass http://filestore;
> }
> 
> the filestore server error log
> 
> 192.168.1.9 - - [12/Aug/2008:23:03:56 +0900] "GET /tst/down.php
> HTTP/1.0" 404 169 "http://proxyserver/tst/" "Mozilla/5.0 (X11; U; Linux
> i686; ja; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1"
> 
> 
> Is there a way to use X-Accel-Redirect with 3 servers or the files to
> download have to be in the proxy server?.

Yes, this should work. Probably, your application and fileserver
are virtual hosts those served by the same server. Probably, you
need to set right Host header.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list