Default route for dynamic endpoints


I have a scenario with 2 different backends. 1 that has a fixed path for requests and the second one is dynamic. The endpoints are created dynamically. So I am trying to build a rule for “everything that doesn´t go to the first path” rule on Caddy.

Thanks much in advanced!

My Caddyfile

:80 {
redir https://{host}{uri}
} {

  tls /root/.caddy/ /root/.caddy/
  log / stdout "{remote} - {user} [{when}] \"{method} {uri} {proto}\" {status} {size} {latency}"
  errors stderr
  timeouts 2h

  proxy /services backend1:8080 {

  proxy / backend2:8080 {    ##Here I need a default route
    policy round_robin

The setup you’ve got there looks good - everything for /services will go to backend one, and anything else will go to backend two. Are you running into any trouble with it?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.