Now:
Reverse Proxy Frontend LXD container:
root@haproxy01:~# caddy run --config /etc/caddy/Caddyfile
2020/03/19 22:30:50.480 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
2020/03/19 22:30:50.482 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["localhost:2019"]}
2020/03/19 22:30:50.483 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2020/03/19 22:30:50.483 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2020/03/19 22:30:50 [INFO][cache:0xc0004abbd0] Started certificate maintenance routine
2020/03/19 22:30:50.485 INFO tls cleaned up storage units
2020/03/19 22:30:50.486 INFO http enabling automatic TLS certificate management {"domains": ["domain.com"]}
2020/03/19 22:30:50.501 INFO autosaved config {"file": "/root/.config/caddy/autosave.json"}
2020/03/19 22:30:50.501 INFO serving initial configuration
Backend LXD container wordpress:
root@wordpress01:~# caddy run --config /etc/caddy/Caddyfile
2020/03/19 22:30:53.335 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
2020/03/19 22:30:53.337 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["localhost:2019"]}
2020/03/19 22:30:53 [INFO][cache:0xc00074b9a0] Started certificate maintenance routine
2020/03/19 22:30:53.338 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2020/03/19 22:30:53.338 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2020/03/19 22:30:53.353 INFO tls setting internal issuer for automation policy that has only internal subjects but no issuer configured {"subjects": ["localhost"]}
2020/03/19 22:30:53.356 INFO tls cleaned up storage units
2020/03/19 22:30:53.469 WARN pki.ca.local trusting root certificate (you might be prompted for password) {"path": "storage:pki/authorities/local/root.crt"}
2020/03/19 22:30:53.470 ERROR pki failed to install root certificate {"error": "not NSS security databases found", "certificate_file": "storage:pki/authorities/local/root.crt"}
2020/03/19 22:30:53.470 INFO http enabling automatic TLS certificate management {"domains": ["localhost"]}
2020/03/19 22:30:53 [WARNING] Stapling OCSP: no OCSP stapling for [localhost]: no OCSP server specified in certificate
2020/03/19 22:30:53.472 INFO autosaved config {"file": "/root/.config/caddy/autosave.json"}
2020/03/19 22:30:53.472 INFO serving initial configuration
And when I try in my firefox, I have :
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
And in frontend revese_proxy log:
2020/03/19 22:33:52.482 INFO http.log.access.log0 handled request {"request": {"method": "GET", "uri": "/", "proto": "HTTP/2.0", "remote_addr": "127.0.0.1:51200", "host": "domain.com", "headers": {"Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"], "Accept-Language": ["fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3"], "Accept-Encoding": ["gzip, deflate, br"], "Dnt": ["1"], "Upgrade-Insecure-Requests": ["1"], "Te": ["trailers"], "User-Agent": ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0"]}, "tls": {"resumed": false, "version": 772, "ciphersuite": 4865, "proto": "h2", "proto_mutual": true, "server_name": "domain.com"}}, "common_log": "127.0.0.1 - - [19/Mar/2020:22:33:52 +0000] \"GET / HTTP/2.0\" 308 0", "latency": 0.002303113, "size": 0, "status": 308, "resp_headers": {"Server": ["Caddy", "Caddy"], "Date": ["Thu, 19 Mar 2020 22:33:52 GMT"], "Content-Length": ["0"], "Location": ["https://domain.com/"]}}
NO activity on backend.