webzod
account

Publish a security.txt file on Caddy

hygiene.security_txt.missing · effort: minutes

Why it matters

A security.txt file tells researchers who to contact when they find a security problem on your site, so a report reaches you instead of being posted publicly or lost. It is a small plain text file defined in RFC 9116.

The fix

  1. Create /var/www/security/.well-known/security.txt with the content shown in the generic tab.
  2. Add a handle block for the path to the site block of example.com. file_server sets Content-Type from the .txt extension, which Caddy serves as text/plain with the utf-8 charset.
  3. Run caddy reload and open https://example.com/.well-known/security.txt to confirm.
Caddyfile
example.com {
	handle /.well-known/security.txt {
		root * /var/www/security
		file_server
	}
	# keep the rest of your site configuration here
}

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.