Skip to content

Instantly share code, notes, and snippets.

@firmanelhakim
Created April 22, 2020 09:43
Show Gist options
  • Save firmanelhakim/c88ffaaaf4c9760da2108dc3499e76fe to your computer and use it in GitHub Desktop.
Save firmanelhakim/c88ffaaaf4c9760da2108dc3499e76fe to your computer and use it in GitHub Desktop.
How to Run Caddy (Reverse Proxy) on Docker

docker run -d --network host --name caddy -p 80:80 -p 443:443 -v $(pwd)/Caddyfile:/etc/caddy/Caddyfile -v $(pwd)/caddy_data:/data caddy/caddy

Caddyfile
{
  # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
  email [email protected]
}

doesnt-exists.com {
  reverse_proxy {
    header_up X-Forwarded-Proto https
    to localhost:5000
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment