# Nginx Webdav & POST method

**URL:** <https://www.ruby-forum.com/t/nginx-webdav-post-method/236975>\
**Category:** NGINX\
**Created:** [October 16, 2013, 11:53am UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975 "2013-10-16T11:53:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [October 16, 2013, 11:53am UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/1 "2013-10-16T11:53:53Z")

</div>

Hello,

We have an appliance which trying to perform POST methods against the  
Nginx server.  
However this doesn’t seem to be supported.  
Could you please confirm me that ?  
And is there a workaround in order to allow POST requests ?

Regards,  
Smana

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 16, 2013, 1:14pm UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/2 "2013-10-16T13:14:31Z")

</div>

Hello!

On Wed, Oct 16, 2013 at 11:53:20AM +0200, removed\_email\_address@domain.invalid wrote:

> We have an appliance which trying to perform POSTmethods against the Nginx  
> server.  
> However this doesn’t seem to be supported.  
> Could you please confirm me that ?  
> And is there a workaround in order to allow POST requests ?

POST requests are more or less undefined in WebDAV (apart from  
relatively new RFC5995, which defines a discovery mechanism  
through which servers can advertise support for POST requests with  
“add collection member” semantics).

What do you expect to happen on POST with WebDAV resources?

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 16, 2013, 1:33pm UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/3 "2013-10-16T13:33:14Z")

</div>

Thank you Maxim,

Actually it’s a video encoding appliance which seems to push files with  
POST request.  
Please find below the error logs :

2013/10/16 09:19:14 [error] 17204#0: \*237 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“PROPFIND /864/ HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:19:27 [error] 17204#0: \*253 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“PROPFIND /864/ HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:20:23 [error] 17204#0: \*282 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“OPTIONS /864/ HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:20:33 [error] 17204#0: \*283 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“OPTIONS /864/ HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:20:38 [error] 17204#0: \*284 user “(” was not found in  
“/etc/nginx/.864\_htpasswd”, client: x.x.x.x, server: localhost, request:  
“OPTIONS /864/ HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:20:39 [error] 17204#0: \*285 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“POST /864/index1\_00001.ts HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:20:39 [error] 17204#0: \*286 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“OPTIONS /864/ HTTP/1.1”, host: “95.81.159.200”

2013/10/16 09:20:39 [error] 17204#0: \*287 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“POST /864/index2\_00001.ts HTTP/1.1”, host: “x.x.x.x”

2013/10/16 09:20:41 [error] 17204#0: \*288 no user/password was provided  
for basic authentication, client: x.x.x.x, server: localhost, request:  
“POST /864/index1\_00001.ts HTTP/1.1”, host: “x.x.x.x”

Don’t take care of the authentication issue, that’s another issue.

Smana

----- Mail original -----  
De: “Maxim D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
À: removed\_email\_address@domain.invalid  
Envoyé: Mercredi 16 Octobre 2013 13:13:53  
Objet: Re: Nginx Webdav & POST method

Hello!

On Wed, Oct 16, 2013 at 11:53:20AM +0200, removed\_email\_address@domain.invalid wrote:

> We have an appliance which trying to perform POST methods against the Nginx  
> server.  
> However this doesn’t seem to be supported.  
> Could you please confirm me that ?  
> And is there a workaround in order to allow POST requests ?

POST requests are more or less undefined in WebDAV (apart from  
relatively new RFC5995, which defines a discovery mechanism  
through which servers can advertise support for POST requests with  
“add collection member” semantics).

What do you expect to happen on POST with WebDAV resources?

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

* * *

nginx mailing list  
removed\_email\_address@domain.invalid  
[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 16, 2013, 1:35pm UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/4 "2013-10-16T13:35:34Z")

</div>

Hello!

On Wed, Oct 16, 2013 at 01:32:19PM +0200, removed\_email\_address@domain.invalid wrote:

> Actually it’s a video encoding appliance which seems to push files with  
> POSTrequest.

It seems that appliance needs to be fixed to properly use WebDAV,  
there is the PUT method to put files.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 16, 2013, 2:09pm UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/5 "2013-10-16T14:09:28Z")

</div>

Thanks Maxim,  
I’ll contact their support in order to understand its behavior.

See you,  
Smana

----- Mail original -----  
De: “Maxim D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
À: removed\_email\_address@domain.invalid  
Envoyé: Mercredi 16 Octobre 2013 13:35:13  
Objet: Re: Nginx Webdav & POST method

Hello!

On Wed, Oct 16, 2013 at 01:32:19PM +0200, removed\_email\_address@domain.invalid wrote:

> Actually it’s a video encoding appliance which seems to push files with  
> POST request.

It seems that appliance needs to be fixed to properly use WebDAV,  
there is the PUT method to put files.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

* * *

nginx mailing list  
removed\_email\_address@domain.invalid  
[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 16, 2013, 3:51pm UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/6 "2013-10-16T15:51:43Z")

</div>

Lol, thanks Jonathan.  
I’ll let you know what the devs will reply to this issue.

You’re right, this should be done from their side as Nginx is rfc  
compliant ^^

But your hack can be usefull under certain circumtances 😛

Regards,  
Smana

----- Mail original -----  
De: “Jonathan M.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
À: removed\_email\_address@domain.invalid  
Envoyé: Mercredi 16 Octobre 2013 15:40:42  
Objet: Re: Nginx Webdav & POST method

On 16 Oct 2013 13:09, \< removed\_email\_address@domain.invalid \> wrote:

> Thanks Maxim,  
> I’ll contact their support in order to understand its behavior.

If you discover that it does indeed use POSTs in an nginx-incompatible  
way, you could use nginx to hack the request into something usable. [ NB  
I’d only do this for an absolutely immutable appliance; in any other  
situation I’d personally tell the devs their code was broken and we  
couldn’t help: don’t inherit other people’s technical debt without a  
commitment to a fix! ]

There’s a directive (proxy\_method?) which changes the verb when used in  
a proxy\_pass’d context.

You could just have a double pass through nginx, with the  
publicly-listening server{} solely being responsible for doing  
s/POST/PUT/ , before proxy\_pass’ing to the actual webdav server via a  
127.0.0.0/8 address. Use a map to define the verb, I suggest.

If it’s not clear from the above how to do this, let me know and I’ll  
run up a test and guide you towards some config. I suggest it’s not very  
difficult to do, however 😉

Yes, this is an utterly horrible hack. No, I have never used it in  
production. Yes, there is an lie hidden in this paragraph.

Cheers,  
Jonathan

* * *

nginx mailing list  
removed\_email\_address@domain.invalid  
[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 16, 2013, 3:41pm UTC](https://www.ruby-forum.com/t/nginx-webdav-post-method/236975/7 "2013-10-16T15:41:12Z")

</div>

On 16 Oct 2013 13:09, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Maxim,  
> I’ll contact their support in order to understand its behavior.

If you discover that it does indeed use POSTs in an nginx-incompatible  
way,  
you could use nginx to hack the request into something usable. [ NB I’d  
only do this for an absolutely immutable appliance; in any other  
situation  
I’d personally tell the devs their code was broken and we couldn’t help:  
don’t inherit other people’s technical debt without a commitment to a  
fix! ]

There’s a directive (proxy\_method?) which changes the verb when used in  
a  
proxy\_pass’d context.

You could just have a double pass through nginx, with the  
publicly-listening server{} solely being responsible for doing  
s/POST/PUT/  
, before proxy\_pass’ing to the actual webdav server via a  
127.0.0.0/8address. Use a map to define the verb, I suggest.

If it’s not clear from the above how to do this, let me know and I’ll  
run  
up a test and guide you towards some config. I suggest it’s not very  
difficult to do, however 😉

Yes, this is an utterly horrible hack. No, I have never used it in  
production. Yes, there is an lie hidden in this paragraph.

Cheers,  
Jonathan
