GameServerWeb.Plugs.AcmeChallenge
(game_server_web v1.0.935)
Copy Markdown
Plug to serve ACME HTTP-01 challenge files for Let's Encrypt certificate validation.
When a Let's Encrypt client (certbot, lego, etc.) requests a certificate, it
places a token file in a webroot directory and the CA verifies ownership by
requesting http://your-domain/.well-known/acme-challenge/<token>.
This plug serves those files from a configurable webroot directory, allowing Phoenix to handle ACME challenges directly without nginx or other reverse proxies.
The plug reads tokens from <webroot>/.well-known/acme-challenge/<token>, which
matches the directory structure created by certbot's --webroot mode.
Configuration
# Set the webroot (same path you pass to certbot --webroot-path)
config :game_server_web, :acme_webroot, "/var/www/acme"Or via the ACME_WEBROOT environment variable (set in runtime.exs).
When the webroot is not configured or does not exist, this plug is a no-op.