Automated TLS Certificates for GSLB-Served Domains¶
When Nexus GSLB is the authoritative nameserver for a zone, standard ACME challenge methods break down:
- HTTP-01 — the CA's validation request hits whichever node the GSLB currently returns, not necessarily the one requesting the certificate.
- TLS-ALPN-01 — same problem; the certificate is on one node but the challenge may land on another.
The correct method is DNS-01: the ACME client writes a _acme-challenge.<domain> TXT record and the CA verifies it via DNS. Because Nexus controls the zone, it can serve that TXT record directly — no external DNS provider needed.
Nexus implements RFC 2136 Dynamic DNS Update with TSIG authentication, which is the standard protocol ACME clients use to write and delete challenge records. Caddy, acme.sh, certbot, and lego all support it.
License: Automated ACME certificate management (
api.tls.acme) requires the paid tier or above. Manual TLS (providing your own cert/key files) is available on all tiers. Contact licensing@gslb.nexus to upgrade.Note: this page covers using Nexus as the DNS-01 responder for other services' ACME clients (Caddy, acme.sh, ...). For Nexus obtaining a certificate for its own API/WebUI, see Nexus's own certificate below.
Nexus's own certificate (api.tls.acme)¶
Nexus can also obtain and auto-renew a certificate for its own API/WebUI listener, via api.tls.acme in config.yaml. This uses DNS-01 against an external DNS provider (not the RFC 2136 responder described above), which also means wildcard domains (e.g. *.s3.example.com) are supported — DNS-01 is the only ACME challenge type that allows them.
api:
tls:
acme:
enabled: true
email: admin@example.com
domains:
- gslb.example.com
# - "*.s3.example.com" # wildcard — requires DNS-01, works the same way
cacheDir: /etc/gslb/acme-cache
dnsProvider: cloudflare # any lego DNS-01 provider name
# directoryURL: "" # empty = Let's Encrypt production; point at any
# other ACME-compatible CA/CLM (Vault PKI, step-ca,
# Sectigo, DigiCert, Google CAS, ZeroSSL, ...)
dnsProvider is one of: cloudflare, route53, gcloud, azuredns, digitalocean, pdns (PowerDNS), bunny. This is a curated subset of lego's DNS provider registry (~90 providers) — lego also ships a generic by-name dispatcher covering all of them, but importing it pulls in every provider's SDK and roughly doubles the gslbd binary size, so only the providers actually needed are wired up (internal/acme/manager.go). Adding another lego-supported provider is a small, contained change (one import + one switch case).
Credentials are never stored in config.yaml. Each provider reads its own credentials from environment variables (lego's convention), which keeps secrets out of a GitOps-committed config repo. Set them in the node's EnvironmentFile (/etc/gslb/env), e.g. for Cloudflare:
See the lego DNS providers list for the variable names required by other providers.
Checking configuration and automation status (read-only)¶
dnsProvider and its credentials live in config.yaml/env vars, not the database — changing them means editing the GitOps-managed config, the same as any other node-bootstrap setting (this is also true of dns.dot/dns.doh). The API/WebUI/TUI accordingly expose the current state read-only rather than as an editable resource.
curl -s https://nexus-api.example.com/api/v1/tls/status \
-H "Authorization: Bearer $GSLB_API_KEY" | jq .acme
{
"email": "admin@example.com",
"domains": ["gslb.example.com"],
"cacheDir": "/etc/gslb/acme-cache",
"directoryURL": "https://acme-v02.api.letsencrypt.org/directory",
"dnsProvider": "cloudflare",
"lastCheckedAt": "2026-07-01T09:00:00Z",
"lastError": ""
}
lastCheckedAt / lastError report the health of the renewal automation itself (the daily background check), separate from the certificate's own validity — so you can tell "automation is running and succeeding" apart from "certificate happens to still be valid." A non-empty lastError means the most recent renewal attempt failed (e.g. bad/expired provider credentials, DNS propagation timeout); the previous certificate keeps serving until a renewal succeeds.
The same fields are shown in the WebUI (/admin/tls → ACME Configuration card → "Automation" row) and via gslbctl tls status.
This certificate can also serve DoT/DoH — leave dns.dot.certFile/keyFile (and/or dns.doh.certFile/keyFile) empty to source them live from this same ACME manager, with automatic renewal and no restart. See DNS Transport Security for details and status fields.
How it works¶
- You create a TSIG key via the Nexus API. The key is stored in the database and loaded into the DNS server immediately — no restart required.
- You configure your ACME client (e.g. Caddy) with the key name and secret.
- When a certificate is requested or renewed, the ACME client sends a TSIG-signed DNS UPDATE to Nexus port 53 (TCP). Nexus writes the
_acme-challengeTXT record. - The CA queries
_acme-challenge.<domain>and sees the record. Challenge passes. - The ACME client sends another UPDATE to delete the TXT record. Nexus removes it.
- The certificate is installed and auto-renewed on this schedule indefinitely.
Each node manages its own certificate independently. There is no shared certificate or cross-node distribution step.
Prerequisites¶
- Nexus GSLB is the authoritative nameserver for the zone (e.g.
gslb.cc). - Port 53 TCP is open between the node running the ACME client and the Nexus DNS server. If the ACME client runs on the same node as Nexus,
127.0.0.1works. - The Nexus API is accessible (default port 8080).
Step 1 — Create a TSIG key¶
Create one key per node so that a compromised node's key can be revoked independently.
curl -s -X POST https://nexus-api.example.com/api/v1/dns/tsig-keys \
-H "Authorization: Bearer $GSLB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "caddy-lon01.gslb.cc.", "algorithm": "hmac-sha256."}' \
| jq .
Response:
{
"id": "a1b2c3d4...",
"tenantId": "default",
"name": "caddy-lon01.gslb.cc.",
"algorithm": "hmac-sha256.",
"secret": "dGhpcyBpcyBhIGJhc2U2NC1lbmNvZGVkIHNlY3JldA==",
"createdAt": 1716000000
}
Save the secret value now. It is shown once and never returned again.
Key naming convention: caddy-<nodename>.<zone>. — any valid DNS name in the served zone works.
Step 2 — Configure Caddy (recommended)¶
Install the caddy-dns/rfc2136 module. With xcaddy:
Or use the official Caddy Docker image with the module pre-built (check the Caddy download page and select the rfc2136 DNS provider).
Caddyfile:
admin.gslb.cc {
reverse_proxy localhost:3000
tls {
dns rfc2136 {
server 127.0.0.1 # Nexus DNS server; use node IP if remote
tsig_key_name caddy-lon01.gslb.cc.
tsig_key_value dGhpcyBpcyBhIGJhc2U2NC1lbmNvZGVkIHNlY3JldA==
tsig_algorithm hmac-sha256
}
}
}
Port 53 TCP — Caddy's rfc2136 module defaults to TCP for DNS UPDATE messages. Ensure the Nexus DNS server is reachable on TCP/53 from the Caddy host (if running on the same node,
127.0.0.1is fine).
Reload Caddy:
Caddy will request a certificate from Let's Encrypt on first load and renew it automatically ~30 days before expiry.
Step 3 — Configure acme.sh (alternative)¶
# Install acme.sh
curl https://get.acme.sh | sh
# Issue certificate using RFC 2136
NSUPDATE_SERVER="127.0.0.1"
NSUPDATE_KEY="caddy-lon01.gslb.cc."
NSUPDATE_KEY_SECRET="dGhpcyBpcyBhIGJhc2U2NC1lbmNvZGVkIHNlY3JldA=="
NSUPDATE_TSIG_ALGO="hmac-sha256"
~/.acme.sh/acme.sh --issue \
--dns dns_nsupdate \
-d admin.gslb.cc \
--server letsencrypt
acme.sh's dns_nsupdate hook calls nsupdate with TSIG to create and delete the challenge record.
Step 4 — Configure cert-manager (Kubernetes, including wildcards)¶
cert-manager's built-in rfc2136 DNS-01 solver speaks the same protocol as the clients above, so no webhook or extra component is needed.
1. Create a least-privilege key — acmeOnly limits it to _acme-challenge.* names, zones to the zone you issue for:
curl -s -X POST https://nexus-api.example.com/api/v1/dns/tsig-keys \
-H "Authorization: Bearer $GSLB_API_KEY" -H "Content-Type: application/json" \
-d '{"name": "cert-manager.example.com.", "algorithm": "hmac-sha256.", "zones": ["example.com."], "acmeOnly": true}'
(or gslbctl tsig-keys create --name cert-manager.example.com. --zones example.com. --acme-only, or the nexus_tsig_key Terraform resource).
2. Store the secret returned by that call:
kubectl -n cert-manager create secret generic nexus-tsig --from-literal=secret='<base64 secret from step 1>'
3. Point a ClusterIssuer at Nexus. nameserver is a Nexus DNS address reachable from the cluster on port 53; tsigAlgorithm must match the key (cert-manager accepts HMACSHA1, HMACSHA256, HMACSHA512 — not SHA-384):
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-nexus
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: you@example.com
privateKeySecretRef:
name: letsencrypt-nexus-account
solvers:
- dns01:
rfc2136:
nameserver: 203.0.113.53:53
tsigKeyName: cert-manager.example.com.
tsigAlgorithm: HMACSHA256
tsigSecretSecretRef:
name: nexus-tsig
key: secret
4. Request a wildcard:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-wildcard
spec:
secretName: example-wildcard-tls
issuerRef:
name: letsencrypt-nexus
kind: ClusterIssuer
dnsNames:
- example.com
- "*.example.com"
Wildcard and apex names both validate at _acme-challenge.example.com, so that name briefly holds two TXT values. Nexus stores TXT by name and value, and cert-manager removes each value individually (an RFC 2136 delete of one specific value), so both challenges coexist and clean up independently.
Troubleshooting: REFUSED in the cert-manager challenge status means the key's scope or tenant does not cover the zone (see RFC 2136 reference); the challenge self-check queries the zone's authoritative nameservers, so they must be reachable from the cluster too.
Multi-node setup¶
Each node should have its own TSIG key. Create a separate key for each:
# lon-01
curl -X POST .../api/v1/dns/tsig-keys \
-d '{"name": "caddy-lon01.gslb.cc.", "algorithm": "hmac-sha256."}'
# eu-01
curl -X POST .../api/v1/dns/tsig-keys \
-d '{"name": "caddy-eu01.gslb.cc.", "algorithm": "hmac-sha256."}'
# lab-01
curl -X POST .../api/v1/dns/tsig-keys \
-d '{"name": "caddy-lab01.gslb.cc.", "algorithm": "hmac-sha256."}'
Each Caddy instance uses its own key name and secret. Configure each node's Caddyfile independently.
Because each node contacts Nexus on 127.0.0.1:53, the challenge records are written to the local DB and replicated to all nodes via the NATS state sync. This means the CA's validation query will see the record regardless of which Nexus node it resolves to.
Verifying the setup¶
Check that the TXT record is being served correctly after Caddy writes it (you can trigger this manually):
# Write a test TXT record via the API
curl -X POST .../api/v1/dns/txt-records \
-H "Authorization: Bearer $GSLB_API_KEY" \
-d '{"name": "_acme-challenge.admin.gslb.cc.", "value": "testtoken123", "ttl": 60}'
# Query it
dig +short TXT _acme-challenge.admin.gslb.cc @<nexus-server-ip>
# Expected: "testtoken123"
# Clean up
curl -X DELETE .../api/v1/dns/txt-records/<id>
Health check considerations¶
With the HTTP health check host fix now in place (see [Health Checks(../reference/HealthChecks.md)), configure your pool health check to probe the FQDN, not the IP:
{
"type": "http",
"port": 443,
"httpPath": "/ui",
"httpHost": "admin.gslb.cc",
"tls": true,
"httpExpectedStatus": 200
}
This ensures the TCP connection reaches the node IP while presenting admin.gslb.cc as both the TLS SNI and HTTP Host header — which Caddy will match against its configured site block.
Security¶
- TSIG keys grant write access to TXT records in the zone. Keep secrets out of version control.
- Scope each key to a single node. Revoke a compromised key with
DELETE /api/v1/dns/tsig-keys/<id>— the key is removed from the live DNS server immediately without a restart. - Nexus rejects RFC 2136 UPDATE messages that are not TSIG-signed with
REFUSED. Unauthenticated update attempts are not possible. - Create ACME keys with
acmeOnly(andzones) so a leaked key can only write_acme-challenge.*records in the zones you named. - UPDATE operations are restricted to TXT record type. Nexus does not allow RFC 2136 to modify A, AAAA, or any other record types.