Nginx proxy zope/webdav, can´t see files


#1

hi,
i´m trying to use nginx to proxy to the zope webdav interface. i´m using
davfs2 for webdav client. and it works well when i connect directly to
the zope/webdav server. but when i proxy using nginx something strange
occurs. i can not see the files using my webdav client. i can upload
files if i connect directly to the folder where i have permissions to
put them. but if i try to list files in the davfs mountpoint, nothing is
shown. niether files nor folders.

the proxy part of my virtualhost looks like this:

                        location /dav/ {
                            proxy_pass 

http://10.10.10.30:1980/plone/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP
$remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
proxy_redirect off;
}

as i understand it nginx when in proxy mode passes data unchanged. so
what would account for the difference between connecting directly and by
way of nginx?

zope http logs of the interaction look like this:
10.10.10.20 - Anonymous [09/Dec/2008:21:03:12 -0500] “OPTIONS /plone/
HTTP/1.0” 200 346 “” “davfs2/1.3.3 neon/0.28.2”
10.10.10.20 - Anonymous [09/Dec/2008:21:03:15 -0500] “PROPFIND /plone/
HTTP/1.0” 401 11557 “” “davfs2/1.3.3 neon/0.28.2”
10.10.10.20 - radracer [09/Dec/2008:21:03:25 -0500] “PROPFIND /plone/
HTTP/1.0” 207 11784 “” “davfs2/1.3.3 neon/0.28.2”
10.10.10.20 - radracer [09/Dec/2008:21:05:47 -0500] “PROPFIND /plone/
HTTP/1.0” 207 11784 “” “davfs2/1.3.3 neon/0.28.2”

i´ve attached some davfs2 http debugging info in case thats helpful.

nginx version is 0.6.34. i´ve also tried with 0.5.35 and 0.4.13

thanks for any help,
kev


#2

Hello,

On Dec 10, 2008, at 4:20 AM, mictlan tecutli wrote:

i´m trying to use nginx to proxy to the zope webdav interface. i´m
using davfs2 for webdav client. and it works well when i connect
directly to the zope/webdav server. but when i proxy using nginx
something strange occurs. i can not see the files using my webdav
client. i can upload files if i connect directly to the folder where
i have permissions to put them. but if i try to list files in the
davfs mountpoint, nothing is shown. niether files nor folders.

Not familiar with zope itself, but WebDAV over nginx works as
advertised in and by itself.

For example, the HTTP server bellow vends its content through WebDAV:

http://svr225.stepx.com:3388/
webdav://svr225.stepx.com:3388/

E.g.:

xxx.xxx.xxx.xxx - - [10/Dec/2008:19:05:48 -0000] “PROPFIND /recent/
HTTP/1.0” 207 137187 - “WebDAVFS/1.7 (01708000) Darwin/9.5.0 (i386)”

For what’s worth, here is the nginx configuration used:

 server
 {
     listen      3388;
     location    /
     {
         proxy_pass          http://cluster;
  proxy_pass_header   Server;
         proxy_set_header    Host $http_host;
         proxy_set_header    X-Forwarded-For $remote_addr;
     }
 }

HTH.

Cheers,


#3

On Tue, Dec 09, 2008 at 09:20:55PM -0600, mictlan tecutli wrote:

                            proxy_redirect   off;

i??ve attached some davfs2 http debugging info in case thats helpful.

nginx version is 0.6.34. i??ve also tried with 0.5.35 and 0.4.13

thanks for any help,
kev

In log I see that OPTIONS’s response has zero length, so you see
nothing:

Dec 9 21:01:36 zas mount.davfs: [hdr] Content-Length: 0

I have no idea why zope may return zero length OPTIONS’s response.


#4

On Dec 10, 2008, at 8:23 PM, Igor S. wrote:

In log I see that OPTIONS’s response has zero length, so you see
nothing:

Dec 9 21:01:36 zas mount.davfs: [hdr] Content-Length: 0

I have no idea why zope may return zero length OPTIONS’s response.

If I’m not mistaken, OPTIONS responses are usually of zero length as
their content are in the ‘allow’ header, no?

In WebDAV, the PROPFIND responses describe the server content.

Cheers,


#5

On Wed, Dec 10, 2008 at 08:49:25PM +0100, Petite A. wrote:

If I’m not mistaken, OPTIONS responses are usually of zero length as
their content are in the ‘allow’ header, no?

In WebDAV, the PROPFIND responses describe the server content.

Yes, you are right.


#6

If I’m not mistaken, OPTIONS responses are usually of zero length as
their content are in the ‘allow’ header, no?

In WebDAV, the PROPFIND responses describe the server content.

i´m sending the two PROFIND responces, one when connecting directly to
zope and the other by way of nginx. as well as a diff of the two. maybe
someone can see something there


#7

On Wed, Dec 10, 2008 at 03:14:23PM -0600, mictlan tecutli wrote:

If I’m not mistaken, OPTIONS responses are usually of zero length as
their content are in the ‘allow’ header, no?

In WebDAV, the PROPFIND responses describe the server content.

i??m sending the two PROFIND responces, one when connecting directly to zope and the other by way of nginx. as well as a diff of the two. maybe someone can see something there

In both case server sends 11500 bytes response.

Probably, the problem is that in nginx case you use “PROPFIND
/dav/nomndaa1/”
while server responses to “PROPFIND /nomndaa1/” or “PROPFIND
/plune/nomndaa1/”
(according previously posted configuration). This may confuse the
client,
if it expect to see response to “PROPFIND /dav/nomndaa1/”: response may
have “/nomndaa1/” or “/plune/nomndaa1/” pathes.


#8

Probably, the problem is that in nginx case you use “PROPFIND /dav/nomndaa1/”
while server responses to “PROPFIND /nomndaa1/” or “PROPFIND /plune/nomndaa1/”
(according previously posted configuration). This may confuse the client,
if it expect to see response to “PROPFIND /dav/nomndaa1/”: response may
have “/nomndaa1/” or “/plune/nomndaa1/” pathes.

so if i understand i should be able to fix this with a proxy_redirect
like:

proxy_redirect http://10.10.10.30:1980/nomndaa1/
http://$host:$server_port/dav/
this is not working for me. the following is the client request, nginx
and zope responces, as well as a modified vhost for nginx.

thanks

client:
Sending request headers: PROPFIND /dav/ HTTP/1.1 Host:
lapalabradelagua.org User-Agent: davfs2/1.3.3 neon/0.28.2 Connection:
TE TE: trailers Depth: 1 Content-Length: 314 Content-Type:
application/xml

nginx log:
“PROPFIND /dav/ HTTP/1.1” 207 11500 “-” “davfs2/1.3.3 neon/0.28.2”

zope log:
“PROPFIND /nomndaa1/ HTTP/1.0” 207 11784 “” “davfs2/1.3.3 neon/0.28.2”

complete nginx vhost:
server {
listen 10.10.10.20:80;
server_name .myhost.org;
if ($request_uri ~* ^/login_(.)) {
rewrite ^/login_(.
) https://$host/login_$1
permanent;
break;
}
location /dav/ {
proxy_pass
http://10.10.10.30:1980/nomndaa1/;
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For
$remote_addr;
proxy_redirect
http://10.10.10.30:1980/nomndaa1/ http://$host:$server_port/dav/;
}
location / {
proxy_pass
http://10.10.10.30:6081/VirtualHostBase/http/myhost.org:80/nomndaa1/VirtualHostRoot/;
proxy_set_header Host $http_host;
}