Can Caddy V1 apply GZIP compression to a proxied response?
Asked Answered
B

0

9

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?

Bainter answered 31/10, 2019 at 12:56 Comment(1)
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 expectedBainter

© 2022 - 2024 — McMap. All rights reserved.