pepejose nginx-forum at nginx.us
Wed Sep 30 11:44:14 MSD 2009

hi! (sorry for my english)

that header only be used with files that are on the hard disk, true ? 

because I have a script to resize the size of some images with php,

in the script i use... getimagesize($image) , then, depending on the size:

1) $thumb=ImageCreateTrueColor($new_x,$new_y)
$im=@imagecreatefromjpeg($image); imagecopyresampled($thumb,$im,0,0,0,0,$new_x,$new_y,$old_x,$old_y); header("Content-type: image/jpeg"); imagejpeg($thumb,'',70);


2) header("Content-type: image/jpeg"); readfile($image);

-- In the first case X-Accel-Redirect not working because the image is in memory?
-- If I change the second case to:

header("Content-type: image/jpeg"); header("X-Accel-Redirect: /$image"); readfile($image);

how can I know if the header X-Accel-Redirect is working?


Posted at Nginx Forum: http://forum.nginx.org/read.php?2,10152,10152#msg-10152

More information about the nginx mailing list