WebDAV - renaming/moving files - Error Bad Gateway (502)

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
zaphod42
Starting out
Posts: 20
Joined: Wed Jun 02, 2010 2:55 pm
Location: Nuremberg, Germany

WebDAV - renaming/moving files - Error Bad Gateway (502)

Post by zaphod42 »

Dear forum members,

I'm using WebDAV (https on port 443) to access files on my QNAP from the internet for quite a while now. Until now, I used it only to download or upload files. But lately I had the demand to rename/move some files via WebDAV and I run into a bad gateway error (502). Whenever I try to rename or move a file it failes with the said error. Everything else is running perfectly, I can create/delete/list directories as well as up- and downloading files or deleting them. Permissions are correct, I'm using "shared folder permission".

I tested with the following WebDAV clients:

FileExplorer - iOS 9.3.2
Total Commander (WebDAV plugin) - Android
CarotDAV - Windows 7x64 Ultimate

My system:

QNAP TS-453 Pro running QTS 4.2.1 (2016/04/19)

After searching the inet, it seems that it is (or might be) a problem with Qnap's webdav proxy configuration. I found the following article explaining the pitfalls with webDAV renaming/moving files:

https://bz.apache.org/bugzilla/show_bug.cgi?id=45449

So, my question is, does anybody noticed this behaviour as well, or am I the only one with this problem? I did not found any post in this forum regarding my problem.

Thanks in advance for any feedback.

Cheers,
Zap
Systems: QNAP TS 453 Pro & QNAP TS 219P

Programming is like s*e*x, one mistake and you have to support it for the rest of your life... (Mike Sinz, Commodore Amiga Developer)
zaphod42
Starting out
Posts: 20
Joined: Wed Jun 02, 2010 2:55 pm
Location: Nuremberg, Germany

Re: WebDAV - renaming/moving files - Error Bad Gateway (502)

Post by zaphod42 »

Hi again,

just to let you know, that I found a solution for it on stackoverflow.

I added the following two lines to /etc/config/apache/extra/apache-dav-proxy.conf

Code: Select all

LoadModule headers_module modules/mod_headers.so
RequestHeader edit Destination ^https http early
just before the <VirtualHost> line.

I then restarted the apache webserver with

Code: Select all

/usr/local/apache/bin/apachectl -k restart
Now everything works as before except that I now can rename and move files via WebDAV.

Don't know if there is a better solution, but this one works.
If you want it to survive a reboot, you have to edit the file in /etc/default_config as well.

Hope this helps others when running into the same problem.

Cheers,
Zap
Systems: QNAP TS 453 Pro & QNAP TS 219P

Programming is like s*e*x, one mistake and you have to support it for the rest of your life... (Mike Sinz, Commodore Amiga Developer)
HassanMullah
Starting out
Posts: 14
Joined: Tue Jul 26, 2011 3:21 pm
Location: Göppingen - Germany

Re: WebDAV - renaming/moving files - Error Bad Gateway (502)

Post by HassanMullah »

Hallo Zap,

da Deine Lokation Germany ist, schreibe ich mal auf deutsch. Ich hoffe von dir noch eine Antwort zu bekommen, da der Thread ja fast schon 3 Jahre alt ist.

Wo genau hast Du denn die Änderungen gemacht? Auf dem Webserver von der QNAP, oder auf dem Reverse Proxy auf einem externen Apache?

Gruß Hassan
User avatar
dolbyman
Guru
Posts: 35252
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: WebDAV - renaming/moving files - Error Bad Gateway (502)

Post by dolbyman »

english only in this forum

if you need to do it in German, check out qnap club deutschland
HassanMullah
Starting out
Posts: 14
Joined: Tue Jul 26, 2011 3:21 pm
Location: Göppingen - Germany

Re: WebDAV - renaming/moving files - Error Bad Gateway (502)

Post by HassanMullah »

I hope to get an answer from you, because the thread is almost 3 years old.

Where exactly did you make the changes? On the webserver of QNAP, or on the reverse proxy on an external Apache?

I tried QNAP, but without success.



Greetings Hassan
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”