[dokuwiki] [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- From: Aleksandar Lazic <al-dokuwiki@xxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sat, 28 Jun 2008 21:16:53 +0200
Any opinion about this mail?
--- Resend
Dear List,
I'am new to dokuwiki but want to suggest a 'optimization' for the
xsendfile = 3 setup (X-Accel-Redirect):
1.) add strip_path to the conf array or maybe use the savedir, I'am not
sure what is the better way.
2.) add in lib/exe/fetch.php
###
diff -u dokuwiki-2008-05-05/lib/exe/fetch.php fetch.php --- dokuwiki-2008-05-05/lib/exe/fetch.php 2008-05-05
19:10:08.000000000 +0200
+++ fetch.php 2008-06-26 01:22:47.000000000 +0200
@@ -121,6 +121,10 @@
header("X-Sendfile: $file");
exit;
}elseif($conf['xsendfile'] == 3){
+ if(isset($conf['strip_path']) && !empty($conf['strip_path'])){
+ $my_path=str_replace($conf['strip_path'],'',$file);
+ $file = $my_path;
+ }
header("X-Accel-Redirect: $file");
exit;
}
###
3.) add the strip_path into the admin menu directly under the xsendfile
entry.
4.) setup in nginx the location as follows:
###
location /data/ {
internal;
alias /virtserver/dokuwiki/data/;
}
###
Why should you change this?
The reason is that nginx expect a url and not a file (
http://wiki.codemongers.com/NginxXSendfile ) so the current requst looks
like this:
X-Accel-Redirect:
/virtserver/dokuwiki/data/cache/a/a35c343a51444078ef7b481250ef70bc.media.200x50.png
for this you need the full path in the location entry in nginx
###
location /virtserver/dokuwiki/data/ {
internal;
alias /virtserver/dokuwiki/data/;
}
###
The new one like this:
X-Accel-Redirect:
/data/cache/a/a35c343a51444078ef7b481250ef70bc.media.50x50.png
for this only the url 'path' in the nginx config as in point 4, I think
it is better ;-).
Due the fact that I'am not so deep into the dokuwiki code, I don't know
the sideeffects for this change.
What does you think about this issue?
Please apologize if this is the wrong list, please point me to the right
way to add such feature requests to dokuwiki.
I have understand from this page:
http://wiki.splitbrain.org/wiki%3Aforum
that I talk for developemt here ;-)
BR
Aleks
----- End forwarded message -----
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- Follow-Ups:
- [dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- From: Anika Henke
Other related posts:
- » [dokuwiki] [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- » [dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- » [dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- » [dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- » [dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- [dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]
- From: Anika Henke