LXC and reverse proxy

I think for your proxy the simplest approach is to just do this:

domain.com {
    reverse_proxy wordpress01:80
    log {
        output file /var/log/caddy/log_domain.com.log
    }
}

Your reverse proxy should terminate TLS and just connect to your wordpress container over HTTP. It will also redirect any http:// connections to https:// (which frankly is the right approach, you shouldn’t let people keep connecting to your server over HTTP).

Alternatively, with Caddy v2 beta 17, you can enable internal TLS with tls internal which sets up a CA. You can install the CA’s root certificate to your proxy’s trust store so that it will trust connections to your backend service. Then, your proxy Caddyfile would look like this:

domain.com {
    reverse_proxy wordpress01:443 {
        transport http {
            tls_trusted_ca_certs path/to/root/ca/cert.pem
        }
    }
    log {
        output file /var/log/caddy/log_domain.com.log
    }
}