惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
月光博客
月光博客
Y
Y Combinator Blog
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
美团技术团队
T
Tailwind CSS Blog
小众软件
小众软件
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More

挖井

免费搭建域名邮箱,使用Cloudflare、Mailgun和Gmail 被优化了 C++ Builder12.1试用体验 Windows平台使调试器在子进程启动时attach 更新FreeBSD、NetBSD、OpenBSD、DragonflyBSD 湖州龙之梦乐园跨年 修改DNS去广告 武夷山之旅 配置Debian路由器双WAN接入
Debian上使用Nginx搭建WebDav服务要点
missdeer · 2023-07-18 · via 挖井

要点:

  1. 不要用Nginx官方的源,而是用Debian的源安装Nginx
  2. 一键安装Nginx及扩展:sudo aptitude -y install nginx-full nginx-extras libnginx-mod-http-dav-ext libnginx-mod-http-auth-pam
  3. 配置要给zone分配内存:dav_ext_lock_zone zone=webdav:10m;

最容易出问题的就是以上3点,其他配置从网上抄一下就行,大体如下:

location / {
    root /home/missdeer/;
    dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
    dav_access user:rw group:rw all:rw;
    dav_ext_lock zone=webdav;

    client_max_body_size 102400M;
    create_full_put_path on;
    client_body_temp_path /tmp/;

    set $dest $http_destination;
    if (-d $request_filename) {
        rewrite ^(.*[^/])$ $1/;
        set $dest $dest/;
    }

    if ($request_method ~ (MOVE|COPY)) {
        more_set_input_headers 'Destination: $dest';
    }

    if ($request_method ~ MKCOL) {
        rewrite ^(.*[^/])$ $1/ break;
    }

    auth_pam "Restricted";
    auth_pam_service_name "common-auth";

    index index.html index.htm index.php admin.php;
}

最后启用Nginx:sudo systemctl restart nginx

如果起不来,先看一下配置文件是否有问题:sudo /sbin/nginx -t