04/20
14:09
日记

Caddy 302跳转

最近听到一些人说Caddy server,就下载下来试试做反向代理,一开始Caddyfile如下

book.hida.in:80 {
gzip
log ./access.log
proxy / localhost:8088
}

浏览器地址栏总是localhost:8088,发现是302重定向到localhost。查阅官方文档,添加一行解决。最终Caddyfile为

book.hida.in:80 {
gzip
log ./access.log
proxy / localhost:8088 {
proxy_header Host {host}
}
}

Caddy 302跳转