Hi there,
I am trying to set up Plone with Caddy as reverse proxy so that I do not have to worry too much about renewing let's encrypt certificates. I based the set up on nginx, Frontend, Backend, PostgreSQL container example — Plone Documentation v6 and replaced the nginx config with a Caddyfile. As soon as I a request goes through Caddy, the start page briefly displays and is very quickly replaced with a server error. When accessing the frontend directly on port 3000, everything works just fine. Thus I think it has to do with my caddy configuration, but I struggle to debug the problem as there simply is no error entry in the logs.
My Caddyfile looks like this
(cloudflare) {
tls {
dns cloudflare ---api-key---
}
}
---hostname--- {
handle_path /++api++* {
@apiPath path_regexp apiPath ^/(\+\+api\+\+\/?)+($|/.*)
rewrite @apiPath /VirtualHostBase/https/{host}/Plone/++api++/VirtualHostRoot/{http.matchers.path.re.apiPath.2}
reverse_proxy backend:8080
}
@staticAssets path *.js *.jsx *.css *.less *.swf *.eot *.ttf *.otf *.woff *.woff2
@staticImages path_regexp staticImages ^/static.*\.(ico|jpg|jpeg|png|gif|svg)$
header @staticAssets Cache-Control "public"
header @staticAssets Expires {http.now.plus.31536000s}
reverse_proxy @staticAssets frontend:3000
reverse_proxy @staticImages frontend:3000
reverse_proxy frontend:3000
import cloudflare
}
(replaced api key and hostname)
So I would have two questions:
- does anyone run a Caddy setup and would be willing to share their config?
- how can I debug this error? The docker logs do not expose any error message, all requests are being returned with a 200 status.
Thanks in advance!