8

I'm running Caddy v1 as a reverse proxy and I would like to apply GZIP compression on e.g. JSON responses.

I noticed that the gzip Caddy v1 directive only applies on files Caddy serves its self but not on responses where Caddy runs a reverse proxy with the proxy directive.

0.0.0.0:8080 {
    gzip {
      ext *
      level 9
    }
    log stdout
    errors stdout

    proxy /api/v2 127.0.0.1:50010 {
          transparent
          without /api/v2
    }
}

Is there a way to compress the proxied response body or is this not possible with Caddy?

saw303
  • 8,051
  • 7
  • 50
  • 90
  • Due to the fact that there is Caddy v2 and Caddy v1 is not anymore supported this question can be considered as obsolete. GZIP in V2 works as expected – saw303 May 16 '22 at 10:00

0 Answers0