help to config nginx

Michael Shadle mike503 at
Wed Sep 2 22:59:59 MSD 2009

On Wed, Sep 2, 2009 at 7:50 AM, pepejose<nginx-forum at> wrote:

> -- I read something about the header "X-Accel-Redirect" then, I wonder if I can use to get something like this:
>  because in my resize.php not resize some images, simply do  header("Content-type: image/gif"); readfile($pic);

this should work.

header("Content-type: image/gif");
header("X-Accel-Redirect: $pic");

However note that $pic needs to be the relative image path, not the
full file path on the filesystem. So it needs to be slightly modified
as $pic would currently be /home/foo/web/, you'd
need it to be just /dir/image.gif

More information about the nginx mailing list