<div dir="ltr">You should be able to just duplicate the MKCOL line in the second map for DELETE, but since MOVE also requires a trailing / on the Destination header, I can't think of a way around it without something much more hacky (I haven't tested it this time, but I think it'll work):<div>
<br></div><div>map $http_destination $dest_missing_slash {</div><div> default 1;</div><div> ~/$ 0;</div><div>}</div><div><br></div><div>map $request_method $proxy_hack {</div><div> default 0;</div>
<div> MOVE $dest_missing_slash;</div><div> COPY $dest_missing_slash;</div><div>}</div><div><br></div><div>server {</div><div> location / {</div><div>
dav_methods MKCOL MOVE COPY DELETE PUT;</div><div> if ($proxy_hack) {<br></div><div> # proxy back to ourselves with a fixed up header</div><div style> # the destination header gets fixed up here, and the uri will get fixed up the second time around</div>
<div style> # you can also listen on a unix port and proxy_pass there for this part</div><div style><br></div><div> proxy_set_header Destination $http_destination/;</div><div style> proxy_pass <a href="http://localhost" target="_blank">http://localhost</a>;<br>
</div><div style> break;</div>
<div> }</div><div><div> if ($add_slash) { rewrite ^ $uri/ break; }</div><div> }</div><div>}</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 15, 2013 at 2:09 AM, Vladimir Dronnikov <span dir="ltr"><<a href="mailto:dronnikov@gmail.com" target="_blank">dronnikov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr">Thanks. That is elegant. Another stopper is that nginx dav does differentiate folders vs files when performing DELETE/MOVE. Is it possible to append slashes if target is a directory? Tia</p>
<div class="gmail_quote">15.06.2013 0:12 ΠΟΜΨΪΟΧΑΤΕΜΨ "Jonathan Kolb" <<a href="mailto:jon@b0g.us" target="_blank">jon@b0g.us</a>> ΞΑΠΙΣΑΜ:<div><div><br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>This worked in a quick test for me:</div><div><br></div>map $uri $missing_slash {<div> default 1;<br><div> ~/$ 0;</div></div><div>}</div><div><br></div><div>map $request_method $add_slash {</div>
<div> default 0;</div><div> MKCOL $missing_slash;</div><div>}</div><div><br></div><div>server {</div><div> location / {</div><div> dav_methods MKCOL;</div><div> if ($add_slash) { rewrite ^ $uri/ break; }</div>
<div> }</div><div>}</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 8:28 AM, Vladimir Dronnikov <span dir="ltr"><<a href="mailto:dronnikov@gmail.com" target="_blank">dronnikov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Any chance to have this trailing slash controlled by an option?<br>
</div>Or would you people mind to share a chunk of nginx config which would append that slash?<br>
</div>TIA<br></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 4:21 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello!<br>
<div><div><br>
On Thu, Jun 13, 2013 at 12:15:54PM +0400, Vladimir Dronnikov wrote:<br>
<br>
> Hello!<br>
><br>
> I wonder if<br>
> <a href="https://github.com/dvv/nginx/commit/3a8cdadea196a594fd1940be02818f51d1b1769fis" target="_blank">https://github.com/dvv/nginx/commit/3a8cdadea196a594fd1940be02818f51d1b1769fis</a><br>
> feasible? The rationale is to be more liberal to the zoo of webdav<br>
> clients.<br>
<br>
</div></div>Doesn't looks like a good change to me.<br>
<span><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/en/donation.html" target="_blank">http://nginx.org/en/donation.html</a><br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</font></span></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br></blockquote></div></div></div>
<br>_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br></blockquote></div><br></div></div>