SSL Config Generator — nginx / Apache / HAProxy Config Builder

Generate a Mozilla-compliant SSL/TLS server configuration for nginx, Apache, HAProxy, or Lighttpd. Modern, Intermediate, or Old profile — with HSTS, OCSP stapling, and HTTP-to-HTTPS redirect.

Profile intermediate · Protocols TLSv1.2 TLSv1.3
nginx · intermediate
# nginx 1.24 | OpenSSL 3.0 | Mozilla intermediate profile
# Generated by OpenFormatter SSL Config Generator

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.com;

    ssl_certificate     /path/to/fullchain.pem;
    ssl_certificate_key /path/to/privkey.pem;
    ssl_dhparam         /path/to/dhparam.pem;

    ssl_session_timeout 1d;
    ssl_session_cache   shared:MozSSL:10m;  # ~40000 sessions
    ssl_session_tickets off;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
    ssl_prefer_server_ciphers off;

    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /path/to/chain.pem;
    resolver 1.1.1.1 8.8.8.8 valid=60s;
    resolver_timeout 2s;

    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
}

What is an SSL Config Generator?

An SSL config generator emits a server-specific TLS configuration block that follows current cryptographic best practice — protocols, cipher suites, session parameters, HSTS, OCSP stapling — instead of asking you to memorize 30+ directives. This tool mirrors the choices made by Mozilla's server-side TLS guidelines, the de-facto standard cited by everyone from PCI auditors to the Web Hosting Initiative.

Pick a server (nginx, Apache, HAProxy, Lighttpd) and a profile (Modern, Intermediate, Old). The output panel updates live; copy the snippet, replace /path/to/fullchain.pem with your real paths, reload, and the site will earn an A+ on SSL Labs.

How to generate a hardened TLS config — 4 steps

  1. Pick your server. nginx and Apache cover the vast majority of public web traffic; HAProxy is dominant for L7 load balancing; Lighttpd shows up on embedded devices and Raspberry Pi.
  2. Choose a profile. Intermediate is the default and is correct for >99% of public sites. Pick Modern only if you can drop every browser older than 2020. Avoid Old unless you specifically need TLS 1.0/1.1.
  3. Toggle features. HSTS on with max-age of 2 years is the new normal. OCSP stapling is free performance and privacy. Always redirect HTTP → HTTPS.
  4. Deploy and test. Update cert paths, reload (nginx -s reload, apachectl graceful, haproxy -sf), then run SSL Labs to confirm the grade.

Sample output (nginx · Intermediate)

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.com;

    ssl_certificate     /path/to/fullchain.pem;
    ssl_certificate_key /path/to/privkey.pem;
    ssl_dhparam         /path/to/dhparam.pem;

    ssl_session_timeout 1d;
    ssl_session_cache   shared:MozSSL:10m;
    ssl_session_tickets off;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:...;
    ssl_prefer_server_ciphers off;

    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /path/to/chain.pem;
    resolver 1.1.1.1 8.8.8.8 valid=60s;

    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
}

Mozilla Profiles Built-In

Cipher lists, protocols, session settings, and OCSP wiring follow Mozilla server-side TLS guidelines — the same source SSL Labs uses to grade you.

A+ on SSL Labs

Default Intermediate output passes Qualys SSL Labs with an A+ when paired with a 2048+ bit cert and HSTS enabled.

Live Preview

Change profile, server, or any toggle and the config updates instantly — no Generate button. Compare nginx vs Apache side-by-side.

Common use cases

  • check_circleConfiguring TLS for a new public website on nginx or Apache
  • check_circleHardening an existing site to fix a B/C grade on SSL Labs
  • check_circleBuilding a reverse-proxy / API gateway TLS termination on HAProxy
  • check_circleSetting up HSTS preload for a flagship domain (max-age >= 1 year, includeSubDomains, preload)
  • check_circleMigrating from TLS 1.0/1.1 to a modern profile after a PCI-DSS audit
  • check_circleAdding OCSP stapling to eliminate per-connection CA lookups
  • check_circleGenerating Lighttpd configs for embedded device firmware and IoT gateways
  • check_circleStandardising TLS settings across a fleet via Ansible / Terraform / Pulumi templates

Why the Mozilla Intermediate profile is the right default

The Intermediate profile (TLS 1.2 + 1.3, ECDHE/DHE forward secrecy, GCM and ChaCha20-Poly1305 ciphers) is what the Mozilla web infrastructure team runs in production and what they recommend for almost every public website. It works in every browser shipped since 2014, including Android 5+, Safari on iOS 9+, Chrome 30+, Firefox 27+, IE 11 on Windows 7+. Modern drops everything below TLS 1.3 — beautiful crypto, but breaks any client older than Android 10, Safari 12.1, or Chrome 70 (~2018). Old resurrects TLS 1.0/1.1 only for sites that must serve Windows XP IE 8 or Android 2.3 — there is almost no legitimate reason to do this in 2026.

security

Your config never leaves your browser

We generate the config — you run it locally so the private key never leaves your server. The generator is pure client-side JavaScript: cipher lists, HSTS values, and your server-version hint never leave the tab. Open DevTools Network and verify no requests are made when you change toggles.

Ship the rest of your TLS stack

Generate certs, decode CSRs, build dhparams — the full TLS lifecycle, browser-side.

Frequently Asked Questions

What is the difference between Modern, Intermediate, and Old?

Modern (TLS 1.3 only) is for sites whose visitors run modern browsers and OSes — drops everything older, gives the strongest cryptography and shortest handshakes. Intermediate (TLS 1.2 + 1.3, default) keeps compatibility with all browsers from 2014 onwards and is the right choice for almost every public website. Old (TLS 1.0+) is only for sites that must support Windows XP IE8 or Android 2.3 — virtually obsolete in 2026.

Should I disable TLS 1.0 and 1.1?

Yes. TLS 1.0 (1999) and 1.1 (2006) are deprecated by the IETF (RFC 8996) and disabled by every major browser since 2020. PCI-DSS 3.2 requires TLS 1.2+. Leaving them enabled does not help any real client and exposes the server to BEAST and CRIME attack variants. Pick Intermediate or Modern profile and they are turned off automatically.

What is HSTS preload?

HSTS (HTTP Strict Transport Security) tells browsers to never use plain HTTP for your domain. The preload list is a hardcoded list shipped with Chrome, Firefox, Safari, and Edge — submit your domain at hstspreload.org and browsers will refuse HTTP from the very first visit (no leak window). Required header: max-age >= 31536000, includeSubDomains, preload. Be sure all subdomains are HTTPS-ready before submitting.

What is OCSP stapling?

When a browser validates a certificate, it must check the CA’s revocation status. Without stapling the browser hits the CA’s OCSP responder on every connection — slow and a privacy leak. With stapling, the server periodically fetches a signed OCSP response and includes it in the TLS handshake itself. Result: faster handshakes, no third-party request, and revocation actually checked (Chrome no longer enforces OCSP without stapling). Enable it.

How do I test my SSL configuration?

Two free scanners cover everything: SSL Labs (ssllabs.com/ssltest) gives a letter grade and lists protocol/cipher/handshake issues. Mozilla Observatory (observatory.mozilla.org) checks HSTS, security headers, and TLS together. For local quick checks, use openssl s_client -connect host:443 -servername host -tls1_3 to confirm a specific protocol negotiates, and testssl.sh for a full offline scan.

What ciphers does TLS 1.3 use?

TLS 1.3 has only five built-in cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256. Selection happens automatically — there is no equivalent of ssl_ciphers for the TLS 1.3 layer. nginx ssl_ciphers and Apache SSLCipherSuite only affect the TLS 1.2 layer; TLS 1.3 ignores them.

Do I need ssl_dhparam?

Only if you enable a DHE (Diffie-Hellman Ephemeral) cipher suite. The Intermediate and Old profiles include DHE-RSA-AES* ciphers as a fallback for clients that lack ECDHE — for those clients, ssl_dhparam controls the DH group size (2048+ recommended; smaller is vulnerable to Logjam). Modern profile is TLS 1.3 only and uses fixed safe groups, so dhparam is not needed.

How do I redirect HTTP to HTTPS?

Enable the toggle and the generator adds a port-80 server block that returns 301 to the HTTPS URL — nginx uses return 301 https://$host$request_uri, Apache uses Redirect permanent, HAProxy uses http-request redirect scheme https. Pair the redirect with a long HSTS max-age so subsequent visits skip HTTP entirely.

SSL Config Generator — nginx, Apache, HAProxy TLS