在这个Caddyfile
中,Caddyv2.2.1似乎不尊重给定地址的端口:
myfinedomain.com:9999 {
respond "Nothing to see here. Srsly."
}
启动caddy只会导致以下错误(摘自日志):
{"level":"info","ts":1614777947.500496,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1614777947.5004952,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0002d2380"}
run: loading initial config: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: address already in use
start: caddy process exited with error: exit status 1
{"level":"info","ts":1614778157.9187949,"msg":"using provided configuration","config_file":"/usr/local/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1614778157.9210048,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["[::1]:2019","127.0.0.1:2019","localhost:2019"]}
{"level":"info","ts":1614778157.9213488,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1614778157.92195,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0002be3f0"}
run: loading initial config: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: address already in use
start: caddy process exited with error: exit status 1
因此,caddy似乎尝试绑定到端口80,而它不应该这样做。
文档将端口列为地址的有效选项。
关于这里可能缺少的东西的想法是值得赞赏的。
https://serverfault.com/questions/1055778
复制相似问题