lucaslorentz / caddy-docker-proxy

Caddy as a reverse proxy for Docker
MIT License
2.85k stars 169 forks source link

Clarification of labels needed #602

Open gcaddy opened 6 months ago

gcaddy commented 6 months ago

Hi!

I am using the well documented reverse proxy configuration in a docker-compose yaml file:

labels:
          caddy: 'test.mydomain.com'
           caddy.reverse_proxy: "{{upstreams 80}}"

This results in the expected

test.mydomain.com {
    reverse_proxy 172.18.0.5:80
}

Now I'd like to achieve basic caching capabilities of Caddy: the website that the nginx has already set caching headers. I would like Caddy serve as the cache that serves static copies of the website. I tried various ways to achieve this with labels and nested arguments but as far as I could observe they were not being implemented. I checked the generated Caddyfile in the caddy-container "/config/caddy/Caddyfile.autosave" and the above configuration was removed. I think because of errors in my configuration. It would be nice to get pointers how I could achieve it.

Thank you.