fix: use 127.0.0.1 instead of localhost in NAS Caddyfile

Prevents Caddy from trying IPv6 [::1] which fails when services
are bound to IPv4 127.0.0.1 only.
This commit is contained in:
Gan, Jimmy
2026-02-28 23:11:28 +08:00
parent 607d09935c
commit 44aafe7ea5
+11 -11
View File
@@ -11,7 +11,7 @@ auth.jimmygan.com {
tls { tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} dns cloudflare {env.CLOUDFLARE_API_TOKEN}
} }
reverse_proxy localhost:9092 reverse_proxy 127.0.0.1:9092
} }
# Protected services with forward_auth # Protected services with forward_auth
@@ -19,22 +19,22 @@ nas.jimmygan.com {
tls { tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} dns cloudflare {env.CLOUDFLARE_API_TOKEN}
} }
forward_auth localhost:9092 { forward_auth 127.0.0.1:9092 {
uri /api/verify?rd=https://auth.jimmygan.com:8443 uri /api/verify?rd=https://auth.jimmygan.com:8443
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
} }
reverse_proxy localhost:4000 reverse_proxy 127.0.0.1:4000
} }
music.jimmygan.com { music.jimmygan.com {
tls { tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} dns cloudflare {env.CLOUDFLARE_API_TOKEN}
} }
forward_auth localhost:9092 { forward_auth 127.0.0.1:9092 {
uri /api/verify?rd=https://auth.jimmygan.com:8443 uri /api/verify?rd=https://auth.jimmygan.com:8443
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
} }
reverse_proxy localhost:4533 { reverse_proxy 127.0.0.1:4533 {
flush_interval -1 flush_interval -1
} }
} }
@@ -43,31 +43,31 @@ n8n.jimmygan.com {
tls { tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} dns cloudflare {env.CLOUDFLARE_API_TOKEN}
} }
forward_auth localhost:9092 { forward_auth 127.0.0.1:9092 {
uri /api/verify?rd=https://auth.jimmygan.com:8443 uri /api/verify?rd=https://auth.jimmygan.com:8443
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
} }
reverse_proxy localhost:5678 reverse_proxy 127.0.0.1:5678
} }
ldap.jimmygan.com { ldap.jimmygan.com {
tls { tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} dns cloudflare {env.CLOUDFLARE_API_TOKEN}
} }
forward_auth localhost:9092 { forward_auth 127.0.0.1:9092 {
uri /api/verify?rd=https://auth.jimmygan.com:8443 uri /api/verify?rd=https://auth.jimmygan.com:8443
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
} }
reverse_proxy localhost:17170 reverse_proxy 127.0.0.1:17170
} }
git.jimmygan.com { git.jimmygan.com {
tls { tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN} dns cloudflare {env.CLOUDFLARE_API_TOKEN}
} }
forward_auth localhost:9092 { forward_auth 127.0.0.1:9092 {
uri /api/verify?rd=https://auth.jimmygan.com:8443 uri /api/verify?rd=https://auth.jimmygan.com:8443
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
} }
reverse_proxy localhost:3300 reverse_proxy 127.0.0.1:3300
} }