[dokuwiki] Re: [al-dokuwiki@xxxxxxx: enhancement for xsendfile]

Hi,

(I am replying to the wrong mail in the thread I know, but I somehow lost the
original :-)).

> I'am new to dokuwiki but want to suggest a 'optimization' for the
> xsendfile = 3 setup (X-Accel-Redirect):
> 
> 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 ;-).

Hmmm, so if I understand it right the point is that you don't have to write the
full path to the data directory in your server configuration (the location
setting)?

As I don't use nginx I had a quick look at the nginx documentation to be able
to understand your proposal so please correct me if I am wrong ;-).

Looking add the other nginx configuration examples this is how the
configuration is expected to look like. The location setting should be relative
to the root or alias setting. But since DokuWiki sends the full path in the
X-Accel-Redirect Header the file isn't found and you have to set the full path
in the location.

At the moment, the xsendfile config option looks like:

  0 = off
  1 = X-LIGHTHTTPD-send-file: lighttpd implementation
  2 = X-Sendfile: standard implementation
  3 = X-Accel-Redirect: I could be wrong, but this is only used by nginx right?

So, if that's the case, we shouldn't need an extra configuration option. When
X-Accel-Redirect is used, stripping the path would be just fine to comply with
the way xginx should be configured correctly.

The only big problem with that is that this would break all existing xginx
setups which are modified to work with xsenfile of course (I don't know how
popular nginx is, Andi might have some numbers?).

So, did I understand that right? Are there any other nginx users subscribed to
the list who have an opinion on this topic?

Best Regards,
    Michi

-- 
Michael Klier

Other related posts: