Setup:
client <-> nginx(:443 SSL) <-> apache(:80 WebDAV)
Client uploads file to webdav server. Upload succeeds but file appears to be 0 bytes in size. When SSHing in to apache server the file is confirmed to be 0 bytes. If I connect to the apache server directly and upload a file everything works as expected. The file uploads and is the correct filesize and md5sum.
I've tried various settings on the nginx and apache server. None of which are successfull. I've googled numerous similar problems but cannot get it to work. Some people say that you need to turn OFF webdav on the nginx server since apache is responsible for all the webdav requests. Could anyone confirm this statement ?
Nginx config:
dav_access user:rw group:rw all:r;
client_max_body_size 50M;
create_full_put_path on;
location / {
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
set $destination $http_destination;
if ($destination ~* ^https(.+)$) {
set $destination http$1;
}
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host drive.domain.com;
proxy_set_header Destination $destination;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Front-End-Https on;
proxy_pass http://webdav;
}