Fix · Caddy
Fix “Exposed .env file” on Caddy
Remove .env from the web root, block dotfiles at the server, and ROTATE every secret that was exposed -- assume it is compromised.
@dotfiles path_regexp /\.
respond @dotfiles 403
Verify the fix
Re-run the Exposed .env file check after deploying. Test config changes in staging first and keep a rollback: a wrong header can break a site faster than a missing one.
Other stacks: nginx · Apache · Express / Node · Cloudflare