I'm having trouble with the xsendfile option and the X-Accel-Redirect header.
When I enable the nginx X-Accel-Redirect header in DokuWiki and configure nginx to pass it, images (for example) return a 200, but are not displayed.
Here are my current settings:
Dokuwiki conf/local.php:
$conf['xsendfile'] = '3';
nginx:
location ~ \.php$ {
include /usr/local/etc/nginx/fastcgi.conf;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_ignore_headers X-Accel-Redirect;
fastcgi_pass_header X-Accel-Redirect;
}
With these settings, when I access image.jpg the browser displays the text:
http://domail.tld/doku/lib/exe/fetch.php?cache=&media=image.jpg
The headers received are:
Server: nginx
Date: Mon, 23 Aug 2010 17:05:36 GMT
Content-Type: image/jpeg
Expires: Tue, 24 Aug 2010 17:05:36 GMT
Cache-Control: public, proxy-revalidate, no-transform, max-age=86400
Pragma: public
Last-Modified: Mon, 23 Aug 2010 17:01:22 GMT
Etag: "a2b5e723e54ec7c46862fc35a7e7f169"
Content-Disposition: inline; filename="image.jpg";
X-Accel-Redirect: /var/www/public_html/domain.tld/public/doku/data/media/image.jpg
200 OK
The request in access logs:
GET /doku/lib/exe/fetch.php?cache=&media=image.jpg HTTP/1.1" 200 5 "http://domain.tld/doku/lib/exe/detail.php?id=start&media=image.jpg
As you can see, the X-Accel-Redirect header and correct mimetype are being passed, but nginx isn't displaying the image.
What am I missing from my DokuWiki/nginx configuration?
Thank you for the help.