HAProxy
The proven route: acme.sh obtains the certificate and its haproxy hook assembles the PEM file HAProxy expects, then reloads the service.
| Value | Where to find it | In this guide |
|---|---|---|
| ACME directory | fixed for each instance | https://certs.example.com/acme/directory |
| Key ID (kid) | Keys & access → EAB credentials | eab_XXXXXXXXXXXXXXXX |
| HMAC key | shown only once, at creation | CLE_HMAC |
1. Account and issuance
acme.sh
acme.sh --register-account --server https://certs.example.com/acme/directory \
--eab-kid eab_XXXXXXXXXXXXXXXX --eab-hmac-key CLE_HMAC -m ops@example.com
mkdir -p /var/lib/acme-webroot
acme.sh --issue --server https://certs.example.com/acme/directory \
-d nas.home.example.com -w /var/lib/acme-webrootThe webroot folder doesn't have to be served by HAProxy: local-cert never reads the challenge.
2. Deploy to HAProxy
acme.sh — haproxy hook
export DEPLOY_HAPROXY_PEM_PATH=/etc/haproxy/certs
export DEPLOY_HAPROXY_RELOAD="systemctl reload haproxy"
acme.sh --deploy -d nas.home.example.com --deploy-hook haproxyThe hook writes /etc/haproxy/certs/nas.home.example.com.pem (certificate, chain and key combined). Both variables are remembered: every renewal run by acme.sh's cron job redeploys and reloads.
3. The frontend
/etc/haproxy/haproxy.cfg (excerpt)
frontend https
bind :443 ssl crt /etc/haproxy/certs/
http-request set-header X-Forwarded-Proto https
use_backend nas if { hdr(host) -i nas.home.example.com }
backend nas
server nas 192.168.1.50:5000