The webdav-plugin works in principle. However, no json files can be copied to the webdav-share. The error message: HTTP Error. Method Not Allowed.
What may need to be added to the nginx configuration?
Thanks for your help
Jochen
The webdav-plugin works in principle. However, no json files can be copied to the webdav-share. The error message: HTTP Error. Method Not Allowed.
What may need to be added to the nginx configuration?
Thanks for your help
Jochen
I can replicate this. I tried a lot of different nginx webdav changes to allow it and I still can't get to accept a json file. If someone has any ideas, I am open to changing the plugin.
My understanding is that routes ending with .json are matching a different location block within the openmediavault-webgui conf file. This results in the file no longer routing to the alias defined in the webdav location block, resulting in the problems here. (this also happens for .php files as well).
My fix has been to add the ^~ prefix so it won't search against other regular expression match. You'll need to add some extra rules to still assign the headers in the other *.json location block. Rewriting the webdav conf below has worked for me, but I'm not too experienced with nginx so hoping I haven't introduced any new problems onto my setup.
location ^~ /webdav {
alias {{ sfpath }};
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
dav_ext_lock zone=foo;
dav_access user:rw group:rw;
create_full_put_path on;
client_body_temp_path /srv/client_temp;
auth_pam "PAM Authentication";
auth_pam_service_name "openmediavault-webdav";
autoindex on;
error_page 404 /_404;
if ($request_method = MKCOL) {
rewrite ^(.*[^/])$ $1/;
}
set $destination $http_destination;
set $parse "";
if ($request_method = MOVE) {
set $parse "${parse}M";
}
if ($request_method = COPY) {
set $parse "${parse}M";
}
if (-d $request_filename) {
rewrite ^(.*[^/])$ $1/;
set $parse "${parse}D";
}
if ($destination ~ ^(https?://.+)$) {
set $ob $1;
set $parse "${parse}R${ob}";
}
if ($request_uri ~* \.(json)$) {
add_header Cache-Control "no-cache, must-revalidate";
add_header Pragma "no-cache";
expires 0;
}
if ($parse ~ ^MDR(.*[^/])$) {
set $mvpath $1;
set $destination "${mvpath}/";
more_set_input_headers "Destination: $destination";
}
}
Display More
I've tried to change the webdav configuration file.
Now .json - files can be copied to the webdav share.
Don’t have an account yet? Register yourself now and be a part of our community!