platinum_pidgeon
platinum_pidgeon

Reputation: 95

How to conditionally apply gzip directive in Caddy?

I am trying to configure Caddy to only use gzip when the Referer header matches a particular domain. This is in order to mitigate a potentially BREACH attack.

However, I do not see a way inside of a Caddyfile that allows me to conditionally turn on gzip based on the value of a header.

The gzip directive here:

https://caddyserver.com/docs/gzip

Only allows conditional application based on path or file extension.

Hopefully this doesn't involve writing a custom directive?

:3333

# How to conditionally apply the following line?
gzip

Upvotes: 0

Views: 777

Answers (0)

Related Questions