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

推荐订阅源

博客园 - 【当耐特】
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Y
Y Combinator Blog
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
I
InfoQ
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
MongoDB | Blog
MongoDB | Blog
T
Tor Project blog
The Register - Security
The Register - Security
H
Help Net Security
Cisco Talos Blog
Cisco Talos Blog
P
Privacy & Cybersecurity Law Blog
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
B
Blog RSS Feed
Latest news
Latest news
T
Threat Research - Cisco Blogs
The Hacker News
The Hacker News
C
Cisco Blogs
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
S
Schneier on Security
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
N
News and Events Feed by Topic
W
WeLiveSecurity

挖井

免费搭建域名邮箱,使用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