Example configs
Pick your server and get one complete TLS config.
Answer four questions, paste the result, then check what a client can negotiate.
Added Updated
How this works
Pick an answer above to start. Each combination has its own page with one complete config, so you never have to assemble pieces. You can change any answer from that page.
Start here if you're not sure:
The four questions
- Which server? We ran every nginx and Caddy combination and checked what a client could negotiate. Apache and HAProxy are built from their documentation and marked untested.
- Which TLS versions? Choose TLS 1.3 only unless you can name a client that needs TLS 1.2. See protocol versions.
- Which certificates? ECDSA P-384 alone suits almost everyone. Add RSA 3072 only for old clients that can't use ECDSA. Caddy manages one certificate per site, so it has no two-certificate option. See certificate strength.
- HSTS for subdomains too? Say yes only when every subdomain serves HTTPS. See HSTS.
What every config has in common
These are not choices, because the rest of this site argues for them:
- Hybrid post-quantum key exchange first, then X25519 and P-384. P-256 is not offered.
- HSTS on every response, and plain HTTP redirected to HTTPS on the same hostname.
- Session tickets and 0-RTT off. Caddy is the exception: it keeps session tickets on and a Caddyfile can't turn them off.
- No OCSP stapling. See revocation.
What "tested" means here
For each nginx and Caddy combination we started the server with that exact config and test certificates, then checked that:
- the hybrid group negotiates, and X25519-only and P-384-only clients connect;
- a P-256-only client is refused;
- TLS 1.2 is refused or accepted as chosen, and never with static RSA, 3DES, RC4 or CBC suites;
- the right certificate is served, including the RSA one to a client that can't use ECDSA;
- the three headers arrive on a normal page and on a 404;
- plain HTTP redirects to HTTPS.
The script that does this is tools/test-configs.mjs in the site's repository. It does not test with real browsers or old devices, so check against your own clients before you ship.
Sources
- nginx: ngx_http_ssl_module fetched
- Caddy: tls directive fetched
- Apache: mod_ssl fetched
- HAProxy configuration manual fetched
- TLS configuration guidelines (formerly Mozilla Server Side TLS) fetched
Changelog
- Replaced the single long page with a picker. Each combination of server, TLS versions, certificates and HSTS scope has its own page. Every nginx and Caddy combination was run and checked.
- Caddy config now drops P-256 for key exchange, asks for a P-384 certificate key and sends Referrer-Policy.
- Fuller nginx config, with TLS settings moved outside the server blocks so the group list applies. Added a default server that refuses unknown hostnames and a Referrer-Policy header. Replaced P-256 with P-384 in every key exchange list. The Apache and HAProxy lists are still untested.
- Changed the certificate key recommendation from P-256 to P-384.
- Clarified the assumptions behind the examples and the expected test results.
- First version. nginx and Caddy configs run and checked by us. Apache and HAProxy not yet.