SSL / Let's Encrypt Generator for Nginx & Apache

Generate the Certbot command to get a certificate, plus the resulting Nginx or Apache SSL config — HSTS and session settings included.

About this tool

The output was tested on real Nginx 1.30 and Apache 2.4 servers, not just read over for typos, which is how it handles some obscure scope rules (like Apache's SSLSessionCache being illegal inside a <VirtualHost> block, and needing a different cache syntax than Nginx entirely) that only a real server actually catches.

Certbot sets up automatic renewal on its own (a systemd timer or cron job, depending on your OS) — verify it's active with systemctl list-timers | grep certbot, and test that renewal actually works without waiting for expiry using certbot renew --dry-run. A cert that fails to silently auto-renew is one of the most common ways sites go down. See How to use ProxyForge for a walkthrough of every setting and where the output goes.

How it works

STEP 1

Pick Nginx or Apache, then choose how Certbot will obtain the cert — automatic, webroot, or standalone.

STEP 2

Enter your domain(s) and, if you like, an email, toggle wildcard or HSTS as needed — both outputs update live.

STEP 3

Run the Certbot command to get the certificate, then copy the SSL config into your existing server block and test it (nginx -t or apachectl configtest) before you reload.

Must match the document root your web server already serves this domain from. Why renewals fail behind a redirect
Comma-separated for multiple domains on one certificate.
Requires a DNS-01 challenge — Certbot can't prove domain ownership over HTTP for a wildcard.
Let's Encrypt stopped sending expiry reminder emails on 4 June 2025 and no longer keeps the address with your account; anything you enter goes to its general mailing list. Leave it blank to add --register-unsafely-without-email instead. Don't use an example.com address: Let's Encrypt refuses it.
Tells browsers to always use HTTPS for this domain from now on.
E.g. the Ubuntu 22.04 and 24.04, Debian 12 and AlmaLinux 9 packages. Check yours with nginx -v. Changes the HTTPS block only. Seeing unknown directive "http2"?
Adds listen [::]:443. Tick it if your server has a public IPv6 address (check with ip -6 addr) and your domain has an AAAA record. If IPv6 is disabled in the server's kernel, Nginx can refuse to start with this line.
STEP 1 — RUN THIS TO GET THE CERTIFICATE
nginx-ssl.conf ✓ Tested on Nginx 1.30

Common errors: unknown directive "http2" · Apache won't start after SSLStaplingCache / OCSP stapling · Let's Encrypt renewal fails behind a redirect · nginx -t passes, nothing on port 443

About cipher suites: this deliberately doesn't hardcode a cipher list. The underlying guidelines keep changing: version 5.8 dropped the DHE ciphers from the Intermediate profile, and version 6.0 removed the old "legacy" profile from the guidelines (the configurator still offers it only as a last resort). Mozilla has since stepped back from actively maintaining its own generator (the project moved to community maintenance as TLS Configurator, which is where ssl-config.mozilla.org now redirects). Rather than bake a cipher list in here and risk it going stale, get the current ssl_ciphers line from TLS Configurator (choose Intermediate, unless you specifically know you want Modern) and drop it into the config below.

Need something Certbot can't give you?

Let's Encrypt (what Certbot uses) only issues free domain-validated certs. For EV/OV certificates, or a wildcard cert without DNS API access, you'd need a paid CA instead:

SSL.com EV, OV, and wildcard certificates with manual domain validation. Get started
UptimeRobot Free uptime monitoring, plus SSL expiry alerts on paid plans — know before a renewal silently fails. Get started
Vultr Simple cloud servers with a wide range of data center locations. Get started

Some links above are affiliate links — signing up through them may earn this site a small commission at no extra cost to you. See the privacy policy for details.