Simple Caddyfile example map microservice name to port

Well, you haven’t told us what’s not working. What symptoms are you seeing? What’s in your logs? What kinds of errors? What do you see in Caddy’s logs? Please be as detailed as possible.

For your microservices, do you need that path prefix to be kept when the request is proxied, or do you need it to be stripped? That’s the main difference between the two you posted, using handle_path will remove that matched path segment from the start of the URL before proxying, whereas just using a matcher on reverse_proxy will not strip the path.

Keep in mind that if these microservices aren’t under your control, you might need to use subdomains for each of them instead of subpaths. See this article which explains why:

1 Like