Nginx Proxy Guard

Getting started

Turning on HTTPS

By the end of this page https://app.example.com opens with a Let's Encrypt certificate, HTTP requests are redirected to HTTPS, and the certificate renews automatically before it expires.

Before you start

  • You have a proxy host that works at http://app.example.com. (Your first proxy host)
  • Choose a validation method.
MethodRequirementWildcard (*.example.com)
HTTP-01The domain points at this server and NPG is reachable from the internet on port 80.No
DNS-01An account at a DNS provider whose API can change the domain's DNS. Port 80 does not need to be open.Yes

DNS-01 supports Cloudflare, AWS Route 53, DuckDNS, Dynu, IONOS and OVHcloud. With any other DNS, you can upload a certificate obtained elsewhere. (When a certificate won't issue)

1. Add a notification email (optional)

In Settings → SSL / ACME, enter an address in ACME Email and save. Let's Encrypt uses it for expiry notices and account recovery. Auto Renew on the same screen is on by default and renews 30 days before expiry.

2. Register a DNS provider (DNS-01 only)

  1. In Certificates → DNS Providers, click Add Provider.
  2. Choose the Provider Type and enter the credentials. For Cloudflare, put a token with the Zone:DNS:Edit and Zone:Read permissions in API Token (Recommended).
  3. Check it with Test Connection, then click Create.
DNS provider list and the add form
DNS provider list and the add form

3. Issue the certificate from the proxy host

  1. Open the host from the Proxy Hosts list and go to the SSL/TLS tab.
  2. Turn on SSL Enabled.
  3. Under Certificate, choose + Create New Certificate.
  4. Choose Let's Encrypt as the Certificate Provider. The certificate covers the domain names from the Basic tab.
  5. In DNS Provider (DNS Challenge), leave HTTP Challenge selected for HTTP-01, or pick the provider from step 2 for DNS-01.
  6. Leave Key type at the default RSA 2048, or choose ECDSA P-256 or ECDSA P-384. Renewals keep the same key type.
  7. Force HTTPS redirects HTTP requests to HTTPS. Keep HTTP/2 on, and turn on HTTP/3 if you want it.
  8. Click Save. NPG shows the issuance log while the certificate is issued, then saves the host.
SSL/TLS tab: SSL enabled, certificate choice, force HTTPS, HTTP/2, HTTP/3
SSL/TLS tab: SSL enabled, certificate choice, force HTTPS, HTTP/2, HTTP/3

You can also create the certificate first and pick it in the host. Click New Certificate under Certificates → Certificates, issue it, then choose Use Existing Certificate on the host's SSL/TLS tab. This is the easier route when several hosts share one wildcard certificate.

New certificate form: Let's Encrypt, DNS-01, DNS provider selected
New certificate form: Let's Encrypt, DNS-01, DNS provider selected

Check that it works

  • Open https://app.example.com and confirm there is no certificate warning.
  • Confirm http://app.example.com redirects to HTTPS (when Force HTTPS is on).
  • In the Certificates → Certificates list, the status is Issued and Expires and Days Left look right.

Good to know

  • HSTS is turned on in the security headers on the Protection tab. Browsers remember it, so if you later turn SSL off, visitors may not be able to reach the site for that period. Turn it on once HTTPS has proven stable.
  • To hear about failed renewals, turn on Certificate renewal failed in Notifications.
  • If issuance fails, see When a certificate won't issue.