Home / Acmefyer / NGINX and Apache
Renew SSL certificates for NGINX and Apache automatically.
A single Linux server easily renews its own certificate. With several web servers, a reverse proxy with many sites and a wildcard certificate that also sits on Windows servers, it turns into manual work. Acmefyer obtains the certificates in one place, and an agent on every Linux server writes the files and reloads NGINX or Apache.
How to replace the SSL certificate in NGINX and Apache by hand.
Both web servers read certificate and key as PEM files. In NGINX the paths are in the server block, in Apache in the virtual host:
# NGINX
ssl_certificate /etc/ssl/example.com/fullchain.pem;
ssl_certificate_key /etc/ssl/example.com/privkey.pem;
# Apache
SSLCertificateFile /etc/ssl/example.com/fullchain.pem
SSLCertificateKeyFile /etc/ssl/example.com/privkey.pem
A replacement means swapping the files, with the full chain and proper permissions for the key. The web server then has to reload, otherwise it keeps serving the old certificate.
- Every server
- Copying and reloading repeat on every web server and for every site with files of its own.
- Distribution
- A certificate for several servers has to get from one place to all of them. Scripts for this need SSH access with root rights in one central place.
- Validation
- For HTTP-01 every server must be reachable from the internet on port 80. Behind a load balancer or on the internal network this often does not work.
- How often
- Since March 2026 public certificates are valid for at most 200 days, from 2029 for only 47 days.
One agent per Linux server, all certificates in one place.
The Acmefyer server obtains the certificate from Let’s Encrypt or another ACME certificate authority and renews it about 30 days before expiry. The Acmefyer agent runs as a service on every Linux server. It picks up the new certificate, writes certificate and key to the paths from the web server’s configuration and reloads NGINX or Apache.
The agent connects outbound to the Acmefyer server only. The Linux servers need no open port and no internet access for this, and no SSH keys for all servers are stored anywhere.
- NGINX and Apache
- Write the certificate with its chain and the key as PEM files, then reload. The reload command is configurable, for example
systemctl reload nginx. - Detection
- The agent finds the sites and virtual hosts with their names, ports, certificate file and the certificate currently in place and suggests the matching deployment.
- Many sites
- A reverse proxy with many sites can be set up in one step. Missing domains are added along the way.
- Reloading once
- When several renewed certificates arrive together, the agent writes all files first and then reloads the web server once.
- Validation
- HTTP-01 through the existing web server: the agent places the validation file in the site’s folder. Without access from the outside it works via DNS-01.
- More targets
- Likewise Traefik, HAProxy, Tomcat and any service that reads PEM files, such as Postfix, Dovecot or PostgreSQL.
- 01
Install the agent
Run the setup package with sudo on the Linux server, or install it over SSH from the Acmefyer server.
- 02
Review the scan
The agent shows the detected NGINX and Apache sites with their certificates.
- 03
Accept the suggestions
One click per site, or all at once. Paths and reload command are already filled in.
- 04
Done
From now on Acmefyer renews the certificates in time and reports every result.
An ACME client with a cron job already renews on the server. What does Acmefyer add?
Does the web server restart during the replacement?
Several sites read the same certificate file. Does that work?
ssl_certificate in the http block of NGINX. Acmefyer then only suggests a certificate that covers the names of all these sites, or creates one with all names. Sites with files of their own each get their own deployment.