X-Accel-Redirect issues - Image of 0 size

Maxim Dounin mdounin at mdounin.ru
Wed Aug 25 20:02:31 MSD 2010


On Wed, Aug 25, 2010 at 11:40:07AM -0400, habodal wrote:

> Thank you, I guess I misunderstood those directives' functions.
> After removing them, now I receive a 404 when attempting to access the
> image. The error log shows:
> [error] 1109#0: *40 open()
> "/var/www/public_html/dev/public/var/www/public_html/dev/public/doku/data/media/image.jpg"
> failed (2: No such file or directory), client:, server:
> dev, request: "GET /doku/lib/exe/fetch.php?cache=&media=image.jpg
> HTTP/1.1", upstream: "fastcgi://unix:/usr/local/var/run/php-fpm.sock:",
> host: "dev", referrer:
> "http://dev/doku/lib/exe/detail.php?id=start&media=image.jpg
> The webroot, /var/www/public_html/dev/public/ appears twice in the
> file's path. How can I prevent this?

Looks like you return file path in X-Accel-Redirect.  You should 
return uri instead, i.e. 

X-Accel-Redirect: /docu/data/media/image.jpg

Maxim Dounin

More information about the nginx mailing list