help to config nginx

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


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

> -- I read something about the header "X-Accel-Redirect" then, I wonder if I can use to get something like this:
> http://kovyrin.net/wp-content/uploads/2006/05/algorithm_c.png  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");
exit();

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/foo.com/dir/image.gif, you'd
need it to be just /dir/image.gif





More information about the nginx mailing list