/etc
├── nginx
│ ├── sites-enabled
│ │ └── domain.tld.port.conf # template attached
│ └── ssl
│ ├── .conf # file attached as `ssl.conf`
│ ├── dhparam.pem # generated
│ ├── fullchain.crt # generated
│ └── crt.key # generated
List of supported DNS providers
// add to .bashrc
export DO_API_KEY="e63f24889...the.rest.of.your.key"
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
In the following, use *.DOMAIN.TLD
to issue and install wildcard cert. Repeat -d
for multiple domains.
# You might want to use your DNS provider's acme.sh plugin in place of dns_dgon, which is for DigitalOcean
acme.sh --issue --dns dns_dgon -d <DOMAIN.TLD>
sudo acme.sh --install-cert -d <DOMAIN.TLD> --key-file /etc/nginx/ssl/cert.key --fullchain-file /etc/nginx/ssl/fullchain.crt
sudo nginx -t
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo nginx -s reload