Really bizarre problem with Sabredav

Cliff Wells cliff at develix.com
Sat Apr 21 20:22:29 UTC 2012


On Sat, 2012-04-21 at 07:49 -0400, squimmy wrote:
> Hi,
> 
> Yeh, I did think about using nginx modules, but that would require
> recompiling nginx unless i'm mistaken? I'm also hoping to integrate this
> with Owncloud, and that uses SabreDav, so getting that working is my
> preferred option.
> 
> These are my Nginx conf files:
> Nginx.conf: http://pastebin.com/fNPkw4fq
> 
> Virtual.conf: http://pastebin.com/N4PZXrBm

Here's what I suspect is happening:

You have location /dav, where I expect is where you want SabreDav to
handle requests.  After that you do:

include /usr/local/nginx/conf/php.conf;
include /include /usr/local/nginx/conf/staticfiles.conf;

I suspect these contain regex locations that are matching your
problematic extensions.  The reason for this is that these regex
locations will take precedence over your /dav location, so when you do a
DAV request such as "PUT /dav/image.jpg", you are really doing the PUT
to a regex location such as "~ \.(jpg|png|gif)$" in staticfiles.conf or
"~ \.php$" in php.conf.

The way Nginx processes requests is outlined here:

http://nginx.org/en/docs/http/request_processing.html

The end result of all of this is you will need to *not* include your
php.conf and staticfiles.conf as top-level locations.  Instead you will
need to include them inside other non-regex locations.

Alternatively, you could setup a subdomain such as dav.domain.com and do
all your DAV requests via that (this is probably the most foolproof).


Regards,
Cliff




More information about the nginx mailing list