Skip to content

Commit 30e73ac

Browse files
committed
Do not listen on port 80 by default.
1 parent 168259c commit 30e73ac

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ domains using multiple godaddy accounts I can now update all my domains
193193
using a single CF_API_KEY for cloudflare. I have thus moved this into
194194
the main Caddyfile under the acme_dns global configuration.
195195

196+
For all of my domains (except one, for backward compatibility) I also do
197+
not expect any unencrypted traffic on port 80, I have thus added
198+
"auto_https disable_redirects" to the base Caddfile to let caddy not
199+
listen on port 80 by default. As I only use the ACME DNS challenge, I do
200+
not need to open that port und thus save myself the headache of the many
201+
probes for security problems, which conveniently only happen on port 80.
202+
196203
### Surviving a tailscaled restart
197204

198205
The docker container mounts the runtime directory of tailscale and not

caddy/config/Caddyfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
cert_issuer acme
44
acme_dns cloudflare {env.CF_API_KEY}
5+
auto_https disable_redirects
56
default_sni {env.CADDY_HOST}
67
storage redis {
78
host "{env.CADDY_REDIS_HOST}"
@@ -86,11 +87,6 @@
8687
header @woff2 Cache-Control "max-age=604800"
8788
}
8889

89-
http:// {
90-
import defaulthdr
91-
redir https://{env.CADDY_HOST} 308
92-
}
93-
9490
{env.CADDY_TAILNET_HOST} {
9591
import defaulthdr
9692
skip_log /health

0 commit comments

Comments
 (0)