Description
Hello,
I am attempting to use Caddy for TLS termination in front of a Varnish cache server.
The configuration for hooking up Caddy to Varnish looks like this:
reverse_proxy 127.0.0.1:8443 {
transport http {
proxy_protocol v2
}
}
The traffic flow works well, but then I wanted to be able to set headers in Varnish based on TLV attributes in the PROXYv2 packets, looking something like this:
sub vcl_recv {
if (proxy.is_ssl()) {
set req.http.X-Forwarded-Proto = "https";
} else {
set req.http.X-Forwarded-Proto = "http";
}
}
This is using the Varnish vmod_proxy
to read TLV values: https://varnish-cache.org/docs/trunk/reference/vmod_proxy.html.
I then noticed that Caddy does not appear to set such values, and based on mastercactapus/proxyprotocol#3 it looks like the currently used proxy protocol library does not support setting them either. I have also seen that there appears to be WIP to start using another proxy protocol lib in #5915.
From what I can tell even if the latter PR is merged this would still not set TLV fields, would it make sense to add such code?