caddy php sock,Caddy环境下一些Web应用程序的配置参考
說明: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
}
}
暫時只列舉這些常用的,如果你需要更多程序的Web配置,可以留言,博主盡量給你提供正確的配置文件。版權聲明:本文為原創文章,版權歸 Rat's Blog 所有,轉載請注明出處!
如教程需要更新,或者相關鏈接出現404,可以在文章下面評論留言。
總結
以上是生活随笔為你收集整理的caddy php sock,Caddy环境下一些Web应用程序的配置参考的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php httprequest 安装,p
- 下一篇: php 自动创建文件,php:自动创建多