webzod
account

Serve security.txt from /.well-known/ on nginx

hygiene.security_txt.legacy_location · effort: minutes

Why it matters

RFC 9116 puts the file at /.well-known/security.txt and keeps /security.txt only for older setups. Researchers and tools look in the standard place first.

The fix

  1. Add an exact-match location that serves the existing file from the standard address, inside the server block for example.com.
  2. Run nginx -t, reload nginx and open https://example.com/.well-known/security.txt.
/etc/nginx/conf.d/example.com.conf
location = /.well-known/security.txt {
    alias /var/www/html/security.txt;
    default_type text/plain;
    charset utf-8;
}

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.