Platforms

By · 4 min read ·

NGINX certificate renewal: files, graceful reloads, and live checks

A practical NGINX TLS renewal checklist: certificate paths, full chains, configuration tests, graceful reloads, containers, and endpoint verification.

On this page

NGINX certificate renewal usually has three parts: obtain a replacement, make it available at the configured paths, and reload the process that serves TLS. The job is finished when a fresh connection presents the expected certificate and the application still responds.

Start by confirming that NGINX actually terminates the connection being tested. A CDN, cloud load balancer, or another proxy in front of it can present a different certificate. Renewing the origin does not automatically renew the edge.

Find the active server block and certificate paths

Identify the server block for the hostname and port. Record the certificate and key paths, the process or container that reads them, and the mechanism that updates them. Include every node serving the hostname.

NGINX's HTTPS configuration guide documents the certificate and private-key directives. It also explains the chain order: the server certificate comes first, followed by intermediate certificates. Restrict access to the private key while allowing the NGINX master process to read it.

Check the active configuration rather than a similarly named file in a deployment repository. An old include file or a mount pointing at another directory can leave a perfectly valid replacement unused.

Keep renewal and deployment responsibilities clear

If an ACME client already owns issuance and installation, understand its renewal hook before adding another script. The hook must run after successful renewal and target the process that owns the listener.

Decide how replacement files are staged and switched. Preserve a working certificate, key, and configuration for recovery. Avoid exposing a partially written file to a reload, and do not overwrite a key unless the matching certificate is ready for the same deployment.

For DNS validation, keep the challenge workflow separate from the file installation. A successful TXT lookup establishes domain control; it does not update NGINX. See ACME DNS validation for that boundary.

Test before a graceful reload

For a conventional host-managed installation, the basic commands are:

sudo nginx -t
sudo nginx -s reload

Run the reload only if the configuration test succeeds. Use the executable, configuration path, and service identity that match your installation. A container or a server with several NGINX instances may need different command targeting.

The official NGINX process control documentation describes graceful reconfiguration: the master validates and applies the configuration, starts new workers, and allows old workers to finish serving existing clients. This is different from assuming a reload has already proved the public service healthy.

Read the reload result and error logs, then make a fresh connection. Do not conclude that a certificate changed by looking at a long-lived connection established before the reload.

Verify the certificate from the client path

Check the expected hostname, names covered, expiry, trust chain, and certificate identity. Then request a harmless application page. Use the monitoring guide's OpenSSL checks for inspection and explicit verification.

If there are multiple nodes, verify them individually through a route that still sends the correct SNI hostname. Also test the public route. A load balancer can otherwise hide a node that missed the update until the next failover or traffic shift.

Be careful about chain testing with a familiar browser. It may have cached an intermediate certificate, masking a server-side omission. A clean verification context helps reveal what the server actually sends.

Account for containers and persistent storage

Inside a container, confirm that the renewed files are visible through the mounted path and that the reload reaches the right master process. Replacing a host file does not prove that every container sees the same content. File mounts and directory mounts can behave differently during replacement, so test the exact deployment method.

Preserve the intended certificate state across restarts. Let's Encrypt's integration guide warns against repeatedly issuing new certificates when ephemeral frontends start without durable certificate storage. Treat renewal as a managed lifecycle, not as an unconditional side effect of starting another replica.

Recover from a failed replacement

If the configuration test fails, stop before reloading and inspect the error. Check the certificate/key pair, chain order, file permissions, and active paths. If a reload succeeds but verification fails, determine whether the issue is the hostname, trust chain, wrong node, or an upstream TLS terminator.

Restore the known working files and configuration when needed, test them, reload, and verify again. Rollback is useful only when the restored certificate remains valid and appropriate for the service. Keep the failure visible until a fresh check confirms recovery.

Expand automation after one complete renewal

Record issuance, deployment, reload, verification, and alert outcomes. Observe a scheduled renewal before extending the method across the fleet. A successful manual reload today does not prove the next unattended renewal will invoke the same hook.

NGINX is in Certonomy's published launch scope alongside Apache, HAProxy, Windows roles, and several firewall platforms. Explore the agent workflow if your team needs one operating view across those targets, with founding access available through the waitlist.