Stop other sites from framing your pages on Caddy
Why it matters
Without frame-ancestors or X-Frame-Options any site can load your pages in an invisible frame and trick visitors into clicking buttons they cannot see. One header tells browsers which sites, if any, may frame them.
The fix
- Add the lines below to the site block and reload. The > prefix sets the header after the upstream answers, replacing a copy from the application; ? adds the CSP only when the application sends none, so if it does, add frame-ancestors 'self' to that policy.
Caddyfile
header >X-Frame-Options SAMEORIGIN header ?Content-Security-Policy "frame-ancestors 'self'"
Related
Scan your domain to see whether this applies to you.