all repos — website @ a4024d05c9f3a6807b212a4570381274e7a88b70

My website

Send security headers with redirects, too
Alan Pearce alan@alanpearce.eu
Tue, 05 Sep 2023 21:11:21 +0200
commit

a4024d05c9f3a6807b212a4570381274e7a88b70

parent

f8ee173f8c1703727d276a6c7a9f6d80b5dbb5e2

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M CaddyfileCaddyfile
@@ -21,7 +21,12 @@ http://, http://alanpearce.uk,
 http://www.alanpearce.uk,
 http://www.alanpearce.eu {
-	header Cache-Control max-age=31536000
+	header {
+		Cache-Control max-age=31536000
+		X-Content-Type-Options nosniff
+		Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
+		Content-Security-Policy "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'"
+	}
 	redir https://alanpearce.eu{uri} permanent
 }