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

推荐订阅源

Last Week in AI
Last Week in AI
Project Zero
Project Zero
L
LINUX DO - 最新话题
C
Cisco Blogs
P
Privacy International News Feed
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
Webroot Blog
Webroot Blog
K
Kaspersky official blog
Help Net Security
Help Net Security
博客园_首页
Security Archives - TechRepublic
Security Archives - TechRepublic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
雷峰网
雷峰网
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
A
Arctic Wolf
I
Intezer
V
V2EX
博客园 - 【当耐特】
Latest news
Latest news
T
Tenable Blog
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
Cyberwarzone
Cyberwarzone
量子位
G
GRAHAM CLULEY
T
Troy Hunt's Blog
博客园 - Franky
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 三生石上(FineUI控件)
TaoSecurity Blog
TaoSecurity Blog
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Jina AI
Jina AI
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Scott Helme
Scott Helme

Rat's Blog - wordpress

零基础的萌新搭建属于自己的Typecho/WordPress等博客教程 - Rat's Blog 小内存VPS一键安装Typecho/WordPress/Zblog/Kodexplorer及整站备份等 - Rat's Blog Caddy环境下WordPress博客伪静态设置 - Rat's Blog VPS服务器如何优化/加快网站的访问速度 - Rat's Blog 使用VPS采集1024贴图区,并自动发布到WordPress博客 - Rat's Blog SC private letter: 一个基于serverchan微信推送服务的私信发送站 - Rat's Blog 好看的WordPress主题:Kratos 2.5.8主题修改美化版,支持PJAX - Rat's Blog 给WordPress、Emlog等博客网站添加下雪特效,附带Typecho下雪插件 - Rat's Blog WordPress博客后台自动更新后,还一直提示更新的解决方法 - Rat's Blog
Caddy环境下一些Web应用程序的配置参考 - Rat's Blog
博主: Rat's · 2018-07-31 · via Rat's Blog - wordpress
  •  发布时间:
  •  31904 次浏览
  •   16 条评论
  •  2657 字数
  • 分类: 建站知识
  1.  首页
  2. 正文  
  3. 分享到:

说明:Caddy是一个轻量级的Web服务器,安装和配置很快,博主也喜欢用,以后的使用范围估计会越来越广,而目前就是一些Web应用程序的配置文件难找,相信很多人都有体会,这里博主就列举常用的一些程序的配置供参考。

配置

以下参数都需要填入配置文件Caddyfile里,且仅作参考。

1、Chevereto图床

example.com {
    root /var/www/chevereto
    fastcgi / /var/run/php/php7.0-fpm.sock php

    rewrite {
        to {path} {path}/ /index.php?{query}
    }
}

2、Nextcloud网盘

my-nextcloud-site.com {

    root   /var/www/nextcloud
    log    /var/log/nextcloud_access.log
    errors /var/log/nextcloud_errors.log

    fastcgi / 127.0.0.1:9000 php {
        env PATH /bin
    }

    header / {
         Strict-Transport-Security       "max-age=15768000;"
    }

    # checks for images
        rewrite {
            ext .svg .gif .png .html .ttf .woff .ico .jpg .jpeg
        r ^/index.php/(.+)$
        to /{1} /index.php?{1}
    }
    
    rewrite {
                r ^/\.well-known/host-meta$
                to /public.php?service=host-meta&{query}
        }
    rewrite {
                r ^/\.well-known/host-meta\.json$
                to /public.php?service=host-meta-json&{query}
        }
    rewrite {
                r ^/\.well-known/webfinger$
                to /public.php?service=webfinger&{query}
        }

    rewrite {
        r ^/index.php/.*$
        to /index.php?{query}
    }

    # client support (e.g. os x calendar / contacts)
    redir /.well-known/carddav /remote.php/carddav 301
    redir /.well-known/caldav /remote.php/caldav 301

    # remove trailing / as it causes errors with php-fpm
    rewrite {
        r ^/remote.php/(webdav|caldav|carddav|dav)(\/?)(\/?)$
        to /remote.php/{1}
    }

    rewrite {
        r ^/remote.php/(webdav|caldav|carddav|dav)/(.+?)(\/?)(\/?)$
        to /remote.php/{1}/{2}
    }

    rewrite {
        r ^/public.php/(dav|webdav|caldav|carddav)(\/?)(\/?)$
        to /public.php/{1}
    }

    rewrite {
        r ^/public.php/(dav|webdav|caldav|carddav)/(.+)(\/?)(\/?)$
        to /public.php/{1}/{2}
    }

    # .htaccess / data / config / ... shouldn't be accessible from outside
    status 403 {
        /.htaccess
        /data
        /config
        /db_structure
        /.xml
        /README
    }

}

3、WordPress博客
配置参考该文章:Caddy环境下WordPress博客伪静态设置

4、Typecho博客
配置参考该文章:小内存VPS安装Caddy+PHP 7+Sqlite 3环境,并快速搭建Typecho博客

暂时只列举这些常用的,如果你需要更多程序的Web配置,可以留言,博主尽量给你提供正确的配置文件。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/689/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。