替代nginx 的caddy 配置
尤其在不能上网的机器 (传统企业开发)
Caddyfile 配置
:80 {
log {
output file /var/log/caddy/access.log {
roll_size_mb 10
roll_keep 5
roll_keep_days 7
}
format json
level DEBUG
}
handle_path /share/* { // handle_path换成route 则 需要
file_server {
root /usr/share/dir
browse on
}
}
}
http://ip.ip.ip.ip/share/123 对应文件 /usr/share/dir/123
handle_path换成route 则对应文件 /usr/share/dir/share/123
命令
在配置同目录下. 配置文件名 Caddyfile
caddy start
caddy reload
caddy stop