Default route for dynamic endpoints

Hi,

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}
}
test.application.io:443 {

  gzip
  tls /root/.caddy/wildcard.application.com/bundle-ca.pem /root/.caddy/wildcard.application.com/key.pem
  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
    transparent
  }
}

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.