Since Pangolin uses Traefik as a reverse proxy, it has built-in support for Let’s Encrypt certificates. This allows you to easily secure your Pangolin instance and all proxied resources with HTTPS. Let’s Encrypt provides free SSL certificates, which are automatically renewed.
HTTP-01 challenge for certificate generation. This challenge is the easiest to configure and requires that the Traefik instance be accessible from the internet on port 80.
It is highly recommended that you read the official Traefik documentation on ACME and Let’s Encrypt before proceeding.
Benefits of Wildcard Certificates
Single Certificate
Secure unlimited subdomains with one certificate, reducing management overhead.
Instant Subdomains
Add new subdomains without waiting for certificate generation (up to a few minutes).
Rate Limit Friendly
Reduce Let’s Encrypt rate limit impact by using fewer certificate requests.
Examples
- A wildcard cert
*.example.comcould protect:api.example.comblog.example.comdashboard.example.com
- Another wildcard
*.subdomain.example.comcould protect:api.subdomain.example.comblog.subdomain.example.com
The rate limits for Let’s Encrypt are per domain. Using a wildcard certificate reduces the number of domains you have, which can help you avoid hitting these limits.
Setting Up Wildcard Certificates
Update Traefik configuration
Update the Traefik configuration to use the DNS-01 challenge instead of the HTTP-01 challenge. This tells Traefik to use your DNS provider to create the DNS records needed for the challenge.
This setting will try to encourage Traefik to request one wildcard certificate for each level of the domain used by your existing resources.Example: If you have two resources
blog.example.com and blog.subdomain.example.com, Traefik should try to request a wildcard certificate for *.example.com and *.subdomain.example.com automatically for you.Traefik Configuration
Default Config for HTTP-01 Challenge
This is the default config generated by the installer. This is shown here for reference to compare with the wildcard config below.1. HTTP Challenge Configuration
1. HTTP Challenge Configuration
Tell Traefik to use the
web entrypoint for the HTTP challenge.traefik_config.yml
2. Dynamic Configuration
2. Dynamic Configuration
Set the cert resolver to
letsencrypt and the entrypoint to websecure in the dynamic config.dynamic_config.yml
Wildcard Config for DNS-01 Challenge
1. Configure DNS Challenge
Tell Traefik to use your DNS provider for the DNS challenge. In this example, we are using Cloudflare.
traefik_config.yml
2. Add Wildcard Domains
Add the domain and wildcard domain to the domains section of the next (front end) router in the dynamic config. This tells Traefik to generate a wildcard certificate for the base domain and all subdomains.
dynamic_config.yml
Traefik supports most DNS providers. A full list of supported providers and configuration instructions (environment variables) can be found in the Lego documentation. Lego (Let’s Encrypt Go) is used by Traefik for DNS challenges.
Verify it Works
Start the stack
Start the stack and watch the logs. You should notice that Traefik is making calls to your DNS provider to create the necessary records to complete the challenge.
Check logs
For debugging purposes, you may find it useful to set the log level of Traefik to
debug in the traefik_config.yml file.Test new resource
After Traefik is done waiting for the cert to verify, try to create a new resource with an unused subdomain. Traefik should not try to generate a new certificate, but instead use the wildcard certificate. The domain should also be secured immediately instead of waiting for a new certificate to be generated.
Troubleshooting
Certificate not generating
Certificate not generating
Problem: Wildcard certificate not being created.Solutions:
- Verify DNS provider credentials are correct
- Check that API token has proper permissions
- Ensure domain ownership and DNS access
- Review Traefik logs for specific error messages
DNS challenge failing
DNS challenge failing
Problem: DNS-01 challenge not completing.Solutions:
- Verify DNS provider is supported by Traefik
- Check API token permissions and scope
- Ensure DNS propagation has completed
- Review provider-specific configuration
- If your DNS provider has a firewall in place, ensure it allows incoming DNS traffic (typically UDP on port 53). Adding an ingress rule to permit such traffic may help resolve the issue, especially if the firewall is stateless.
Old certificates still being used
Old certificates still being used
Problem: Traefik using old HTTP-01 certificates.Solution: Delete the
acme.json file to force new certificate generation.
