--- /dev/null
+# Example: ACME dns-01 automation via Lua event callbacks
+#
+# The Lua script serializes Gandi LiveDNS TXT updates per certificate/domain
+# and acknowledges each apex or wildcard authorization separately.
+# Cleanup deletes the complete challenge RRset; use dedicated test names.
+#
+# Run from the repository root:
+# haproxy -f examples/acme-lua.cfg
+#
+# Requirements:
+# - HAProxy built with USE_SSL=1 USE_LUA=1
+# - OpenSSL >= 1.1.1 (HAVE_ACME)
+# - GANDI_API_KEY environment variable with a Gandi Personal Access Token
+# Use lua-load, not lua-load-per-thread: per-domain publication locks belong to
+# one Lua state. Other DNS writers require external coordination.
+
+global
+ setenv GANDI_API_KEY myapikey
+ expose-experimental-directives
+ tune.lua.bool-sample-conversion normal
+ lua-load examples/lua/acme-gandi-livedns.lua
+ log stderr local0
+
+# ---------------------------------------------------------------------------
+# ACME section: describes the CA, the account and the challenge type.
+# ---------------------------------------------------------------------------
+acme letsencrypt
+ directory https://acme-staging-v02.api.letsencrypt.org/directory
+# directory https://acme-v02.api.letsencrypt.org/directory
+ contact doe@example.com
+ account-key examples/acme-account.key
+ challenge dns-01
+ challenge-ready cli,dns
+
+# ---------------------------------------------------------------------------
+# crt-store: maps the certificate file to the ACME section and SANs.
+# ---------------------------------------------------------------------------
+crt-store
+ load crt examples/acme-example.com.pem acme letsencrypt domains *.example.com.example.com
+
+# ---------------------------------------------------------------------------
+# Frontend: terminates TLS with the ACME-managed certificate.
+# ---------------------------------------------------------------------------
+frontend https
+ bind *:8443 ssl crt examples/acme-example.com.pem alpn h2,http/1.1
+ default_backend webservers
+
+backend webservers
+ server web1 127.0.0.1:8080 check