Caddy:修订间差异
来自iSrv 百科
更多操作
无编辑摘要 标签:手工回退 |
无编辑摘要 |
||
| 第12行: | 第12行: | ||
== 配置 == | == 配置 == | ||
nginx | |||
<syntaxhighlight lang="nginx"> | <syntaxhighlight lang="nginx"> | ||
example.com { | example.com { | ||
reverse_proxy localhost:3000 | reverse_proxy localhost:3000 | ||
} | |||
</syntaxhighlight> | |||
caddyfile | |||
<syntaxhighlight lang="caddyfile"> | |||
:80 { | |||
root * /srv/www/mediawiki-1.45.3 | |||
encode gzip zstd | |||
php_fastcgi 127.0.0.1:9000 | |||
file_server | |||
try_files {path} {path}/index.php?{query} | |||
@staticAssets path *.css *.js *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf | |||
header @staticAssets Cache-Control "public, max-age=2592000" | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
2026年7月2日 (四) 16:25的版本
Caddy
简介
一款自动 HTTPS Web 服务器。
安装
sudo pacman -S caddy配置
nginx
example.com {
reverse_proxy localhost:3000
}caddyfile
:80 {
root * /srv/www/mediawiki-1.45.3
encode gzip zstd
php_fastcgi 127.0.0.1:9000
file_server
try_files {path} {path}/index.php?{query}
@staticAssets path *.css *.js *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf
header @staticAssets Cache-Control "public, max-age=2592000"
}常见问题
php-fpm 无法连接
检查:
ls -l /run/php-fpm/php-fpm.sock参考
caddy
用于替代nginx反代站点
目前已经完成nginx配置迁移caddy工作。