Security Header Generator

Generate recommended security header configurations for your web server.

Options

Generated in your browser — copy the block into your server configuration.

Configuration

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;

What these headers do

Security headers are one-line instructions your server sends with every response. HSTS (Strict-Transport-Security) tells browsers to insist on HTTPS; X-Frame-Options stops other sites framing your pages; X-Content-Type-Options stops browsers guessing file types. Together they close off a family of common attacks at almost no cost.

Common issues

How to check your work

After deploying, run your domain through the TLS tester — it reads the headers straight off your live site — or inspect the raw response with the HTTP tester.