lucaslorentz / caddy-docker-proxy

Caddy as a reverse proxy for Docker
MIT License
2.61k stars 163 forks source link

Using a path in a site address is deprecated; please use the 'handle' directive instead #593

Closed sowinski closed 3 months ago

sowinski commented 3 months ago

Hi,

I have two containers in my project. One is serving the main page and one is serving an login area.

Currently my labels for both containers look like that:

Main-Container

labels:
      caddy: "www.example.com"
      caddy.reverse_proxy: "{{upstreams 8000}}"

Login-Area

labels:
  caddy: "www.example.com/myapp/*"
  caddy.handle: "/myapp/*"
  caddy.reverse_proxy: "{{upstreams 3000}}"

If I replace caddy: *"www.example.com/myapp/" with caddy: "www.example.com/"** it is not working. The generated file is obviously wrong.

cat Caddyfile.autosave

www.example.com {
    handle /myapp/*
    reverse_proxy 172.29.0.3:3000 172.29.0.4:8000
}

What would be the correct way of doing this?

sowinski commented 3 months ago

Got it...

labels:
  caddy: "www.example.com"
  caddy.handle: "/myapp/*"
  caddy.handle.reverse_proxy: "{{upstreams 3000}}"

caddy.handle.reverse_proxy: "{{upstreams 3000}}"