vmod_header can be used in vcl_backend_fetch?

Geoff Simmons geoff at uplex.de
Mon Nov 27 12:21:49 UTC 2017


On 11/27/2017 01:04 PM, matrix wrote:
> 
> According to varnishlog Bereq header are displayed but origin server
> log, only Accept-Encoding: aaaa .
> 
> -   BereqHeader    Accept-Encoding: aaaa
> -   BereqHeader    Accept-Encoding: bbbb
> 
> I would like to change  Accept-Encoding Header to br,gzip, because the
> varnish is force replaced Accept-Encoding gzip when backend request.
> 
> VCL
> unset bereq.http.Accept-Encoding;
> header.append(bereq.http.Accept-Encoding, "aaaa");
> header.append(bereq.http.Accept-Encoding, "bbbb");

After the header.append()s you can use:

std.collect(bereq.http.Accept-Encoding)

... to combine them into a single header with comma-separated values.

https://varnish-cache.org/docs/5.2/reference/vmod_std.generated.html#func-collect

Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20171127/9c0e573e/attachment.bin>


More information about the varnish-misc mailing list