Traefik
Overview
Section titled “Overview”Traefik is a modern reverse proxy and load balancer.
Key features:
- Automatic service discovery
- Let’s Encrypt integration
- HTTP/2 and gRPC support
- Dashboard and metrics
Installation
Section titled “Installation”shc install traefik --stack proxyCommon variables:
email- Email for Let’s Encryptdashboard_host- Dashboard hostnamedashboard_user- Dashboard usernamedashboard_password- Dashboard password
Configuration
Section titled “Configuration”Traefik automatically discovers services with public_hosts:
# In app.yamlservices: web: public_hosts: - myapp.example.comSHC generates Traefik labels automatically:
- Router rules
- TLS configuration
- Certificate resolver
TLS Defaults
Section titled “TLS Defaults”TLS is only enabled when explicitly requested (for example via CLI flags). When enabled without an explicit mode, Traefik uses ACME HTTP-01 by default. DNS-01 is available when selected and a DNS provider is configured.
DNS Providers
Section titled “DNS Providers”SHC manages DNS records for --host deployments using the resolved provider
for that deployment scope. Traefik receives provider updates only when DNS
providers are added, removed, or modified in SHC config.
DNS-01 propagation pre-check
Section titled “DNS-01 propagation pre-check”Before telling the ACME CA that a DNS-01 challenge is ready, lego checks that
the challenge TXT record is actually being served. Left to its defaults that
check runs against the node’s own recursive resolver and fires roughly a
second after the record is created — usually before the DNS provider’s edge
serves it. The resolver answers NXDOMAIN and caches that negative for the
zone’s SOA minimum (commonly 1800s), lego then polls the poisoned cache until
the order times out, and Traefik re-poisons it on the next retry. The estate
does not recover on its own: every DNS-01 issuance stays stuck until the
negative cache expires.
Every DNS-01 certificate resolver SHC seeds therefore carries two settings:
| Var | Default | Effect |
|---|---|---|
dns01.checkResolvers | 1.1.1.1:53,8.8.8.8:53 | Runs the pre-check against these servers instead of the node’s own resolver, so a negative answer never contaminates the resolver everything else on the node shares. |
dns01.checkDelay | 30s | Delays the first pre-check query so the record is genuinely being served before anything asks for it. Costs its value once per ACME order, on the DNS-01 path only. |
Both are ordinary install vars on the system Traefik stack, so they are overridable without forking the app:
shc config set system.apps.traefik.vars.dns01.checkResolvers "10.0.0.53:53"shc config set system.apps.traefik.vars.dns01.checkDelay "60s"The defaults assume a public zone. Change them when that is not your topology:
- Split-horizon / internal DNS — point
checkResolversat the server that is authoritative for the zone being challenged. A public resolver answers for the public view and will disagree with the internal record. - Airgapped —
1.1.1.1and8.8.8.8are unreachable and every check will time out. SetcheckResolversto the estate’s own authoritative nameserver (the in-estate PowerDNS / BIND / RFC2136 target the DNS-01 provider writes to). - Opt out — set either var to
"". That key is then not emitted at all and Traefik keeps its stock behaviour.
A change to either var re-renders and restarts Traefik. Already-issued certificates live in the bind-mounted ACME storage and survive the restart.
Integration with Other Apps
Section titled “Integration with Other Apps”Apps connect to Traefik via the traefik_access network:
shc install traefik --stack proxyshc install nextcloud --stack cloud # Auto-connects to TraefikAccess public URL: https://cloud.example.com
Dashboard
Section titled “Dashboard”Access Traefik dashboard:
- URL: https://{dashboard_host}
- Username: {dashboard_user}
- Password: {dashboard_password}
Troubleshooting
Section titled “Troubleshooting”Common issues:
Problem: SSL certificate not issued Solution: Verify DNS points to server, check email configuration
Problem: Service not accessible
Solution: Check the deployment is healthy with shc status myapp, then inspect the rendered Traefik labels via shc inspect myapp
Problem: Dashboard shows 404 Solution: Verify dashboard_host configuration