I am using the github project - https://github.com/lensesio/schema-registry-ui to manage Kafka schema registry. We have it set up as a docker container - https://hub.docker.com/r/landoop/schema-registry-ui/builds. Unfortunately, Caddy v1 has been deemed a security risk so we are trying to update to Caddy v2.
I am trying to upgrade to Caddy v1 to v2 so I am trying to update the Caddyfile (while going through the upgrade doc). The current error I am getting is “Client sent an HTTP request to an HTTPS server.” I thought that the “auto_https off” would fix it.
A part of the problem is that I don’t exactly understand what is trying to be done in the v1 config I posted above (not my github project)… I assume it is a reverse proxy connecting to the api of schema registry - I am trying to take the exact v1 config and translate it to v2
Try using http://:8000 for your site label instead of 0.0.0.0:8000 if you specifically want HTTP on port 8000.
Yes, that appears to be the behaviour of the v1 config.
It takes any request for /api/schema-registry, strips that prefix from the URI, and sends it upstream.
Stripping the prefix in v1 was function of the proxy directive out of necessity (if you couldn’t do it in the proxy, it was exceedingly difficult to do it otherwise). In v2 this functionality doesn’t need to be part of the reverse proxy module because you can rewrite the URI yourself first. This is touched on in the v2 upgrade guide, under the proxy heading: Upgrading to Caddy 2 — Caddy Documentation
A common config pattern for this purpose looks like:
route /<prefix>* {
uri strip_prefix /<prefix>
reverse_proxy <upstream>
}