http – 如何在Nginx服务器上允许PUT文件请求?

我正在使用一个需要在HTTP服务器上输出文件的应用程序.我使用Nginx作为服务器,但返回405 Not Noted错误.以下是使用cURL进行测试的示例:

curl -X PUT \
-H 'Content-Type: application/x-mpegurl' \
-d /Volumes/Extra/playlist.m3u8 http://xyz.com

我从Nginx那里得到了什么:

Nginx/1.1.19

允许PUT需要做什么?

任何线索都会很棒!

最佳答案
添加HTTP和WebDAV方法,如PUT,DELETE,MKCOL,copY和MOVE,您需要使用HttpDavModule(./configure –with-http_dav_module)编译Nginx.首先检查Nginx -V,也许你已经有了HttpDavModule(I installed nginx from the Debian repository and I already have the module).

然后改变你的Nginx-config

location / {
    root     /var/www;
    dav_methods  PUT;
}

您可以在nginx docs entry for the HttpDavModule获得更多信息.

相关文章

Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一...
本地项目配置 1 复制 luffy/settings/dev.py为prop.py 修改l...
nginx不仅可以隐藏版本信息,还支持自定义web服务器信息 先看...
一 、此次漏洞分析 1 nginx HTTP/2漏洞 [nginx-announce] ng...
###进入nginx 目录cd /usr/local/nginx###递归显示 2 级目录...
在cmd命令窗口输入下面命令进行查看 tasklist /fi "ima...