<div dir="ltr">So the varnishlog confirms the vmods works as expected:<div><br></div><div><span style="font-size:12.8px">-   BereqUnset     Accept-Encoding: gzip</span><br></div><div><span style="font-size:12.8px">-   BereqHeader    Accept-Encoding: aaaa</span><br style="font-size:12.8px"><span style="font-size:12.8px">-   BereqHeader    Accept-Encoding: bbbb</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">bereq is "BackEnd REQuest", if you want to change the "BackEnd RESPonse", use beresp.http.*.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">And you can simply to:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">set bereq.http.accept-encoding = "br, gzip";</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Just know that while varnish natively support gzip, it's not the case for brotli. You can have a look at this blog post: <a href="https://info.varnish-software.com/blog/varnish-cache-brotli-compression">https://info.varnish-software.com/blog/varnish-cache-brotli-compression</a></span></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div>
<br><div class="gmail_quote">On Mon, Nov 27, 2017 at 1:04 PM, matrix <span dir="ltr"><<a href="mailto:matrix@matrix2000.name" target="_blank">matrix@matrix2000.name</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi thank you for your reply<br>
<br>
According to varnishlog Bereq header are displayed but origin server<br>
log, only Accept-Encoding: aaaa .<br>
<br>
-   BereqHeader    Accept-Encoding: aaaa<br>
-   BereqHeader    Accept-Encoding: bbbb<br>
<br>
I would like to change  Accept-Encoding Header to br,gzip, because the<br>
varnish is force replaced Accept-Encoding gzip when backend request.<br>
<br>
VCL<br>
unset bereq.http.Accept-Encoding;<br>
header.append(bereq.http.<wbr>Accept-Encoding, "aaaa");<br>
header.append(bereq.http.<wbr>Accept-Encoding, "bbbb");<br>
<br>
<br>
Full varnishlog below<br>
<br>
*   << BeReq    >> 3<br>
-   Begin          bereq 2 fetch<br>
-   Timestamp      Start: 1511783436.988432 0.000000 0.000000<br>
-   BereqMethod    GET<br>
-   BereqURL       /cache/200.php<br>
-   BereqProtocol  HTTP/1.1<br>
-   BereqHeader    User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu)<br>
libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2<br>
-   BereqHeader    Accept: */*<br>
-   BereqHeader    host: <a href="http://test.com" rel="noreferrer" target="_blank">test.com</a><br>
-   BereqHeader    Accept-Encoding: gzip<br>
-   BereqHeader    Surrogate-Capability: key=ESI/1.0<br>
-   BereqHeader    X-Cache-Key: /cache/200.php<br>
-   BereqHeader    X-Varnish: 3<br>
-   VCL_call       BACKEND_FETCH<br>
-   BereqUnset     Accept-Encoding: gzip<br>
-   BereqHeader    Accept-Encoding: aaaa<br>
-   BereqHeader    Accept-Encoding: bbbb<br>
-   VCL_return     fetch<br>
-   BackendOpen    21 boot.backend1 127.0.0.1 81 127.0.0.1 51782<br>
-   BackendStart   127.0.0.1 81<br>
-   Timestamp      Bereq: 1511783436.988549 0.000118 0.000118<br>
-   Timestamp      Beresp: 1511783437.198227 0.209795 0.209677<br>
-   BerespProtocol HTTP/1.1<br>
-   BerespStatus   404<br>
-   BerespReason   Not Found<br>
-   BerespHeader   Date: Mon, 27 Nov 2017 11:50:37 GMT<br>
-   BerespHeader   Content-Type: text/html; charset=UTF-8<br>
-   BerespHeader   Transfer-Encoding: chunked<br>
-   BerespHeader   Connection: keep-alive<br>
-   BerespHeader   Vary: Accept-Encoding<br>
-   TTL            RFC 86400 10 -1 1511783437 1511783437 1511783437 0 0<br>
-   VCL_call       BACKEND_RESPONSE<br>
-   TTL            VCL 300 10 0 1511783437<br>
-   VCL_return     deliver<br>
-   Storage        file disk<br>
-   ObjProtocol    HTTP/1.1<br>
-   ObjStatus      404<br>
-   ObjReason      Not Found<br>
-   ObjHeader      Date: Mon, 27 Nov 2017 11:50:37 GMT<br>
-   ObjHeader      Content-Type: text/html; charset=UTF-8<br>
-   ObjHeader      Vary: Accept-Encoding<br>
-   Fetch_Body     2 chunked stream<br>
-   BackendReuse   21 boot.backend1<br>
-   Timestamp      BerespBody: 1511783437.198340 0.209908 0.000113<br>
-   Length         16<br>
-   BereqAcct      569 0 569 178 16 194<br>
-   End<br>
<br>
*   << Request  >> 2<br>
-   Begin          req 1 rxreq<br>
-   Timestamp      Start: 1511783436.988227 0.000000 0.000000<br>
-   Timestamp      Req: 1511783436.988227 0.000000 0.000000<br>
-   ReqStart       x.x.x.x 62656<br>
-   ReqMethod      GET<br>
-   ReqURL         /cache/200.php?1234<br>
-   ReqProtocol    HTTP/1.1<br>
-   ReqHeader      User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu)<br>
libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2<br>
-   ReqHeader      Accept: */*<br>
-   ReqHeader      Host:<a href="http://test.com" rel="noreferrer" target="_blank">test.com</a><br>
-   ReqHeader      Accept-Encoding: gzip,deflate<br>
-   VCL_call       RECV<br>
-   ReqUnset       Host:<a href="http://test.com" rel="noreferrer" target="_blank">test.com</a><br>
-   ReqHeader      host: <a href="http://test.com" rel="noreferrer" target="_blank">test.com</a><br>
-   ReqUnset       Accept-Encoding: gzip,deflate<br>
-   ReqHeader      Accept-Encoding: gzip<br>
-   ReqHeader      Surrogate-Capability: key=ESI/1.0<br>
-   ReqURL         /cache/200.php<br>
-   VCL_return     hash<br>
-   VCL_call       HASH<br>
-   ReqHeader      X-Cache-Key: /cache/200.php<br>
-   VCL_Log        redhash<br>
-   ReqUnset       X-Cache-Key: /cache/200.php<br>
-   ReqHeader      X-Cache-Key: /cache/200.php<br>
-   VCL_return     lookup<br>
-   VCL_call       MISS<br>
-   VCL_Log        redmiss<br>
-   VCL_return     fetch<br>
-   Link           bereq 3 fetch<br>
-   Timestamp      Fetch: 1511783437.198397 0.210170 0.210170<br>
-   RespProtocol   HTTP/1.1<br>
-   RespStatus     404<br>
-   RespReason     Not Found<br>
-   RespHeader     Date: Mon, 27 Nov 2017 11:50:37 GMT<br>
-   RespHeader     Content-Type: text/html; charset=UTF-8<br>
-   RespHeader     Vary: Accept-Encoding<br>
-   RespHeader     X-Varnish: 2<br>
-   RespHeader     Age: 0<br>
-   RespHeader     Via: 1.1 varnish-v4<br>
-   VCL_call       DELIVER<br>
-   VCL_Log        reddeliver<br>
-   RespUnset      X-Varnish: 2<br>
-   RespUnset      Via: 1.1 varnish-v4<br>
-   VCL_return     deliver<br>
-   Timestamp      Process: 1511783437.198471 0.210244 0.000074<br>
-   RespHeader     Content-Length: 16<br>
-   Debug          "RES_MODE 2"<br>
-   RespHeader     Connection: keep-alive<br>
-   Timestamp      Resp: 1511783437.198515 0.210288 0.000044<br>
-   ReqAcct        219 0 219 282 16 298<br>
-   End<br>
<br>
*   << Session  >> 1<br>
-   Begin          sess 0 HTTP/1<br>
-   SessOpen       x.x.x.x 62656 <a href="http://0.0.0.0:80" rel="noreferrer" target="_blank">0.0.0.0:80</a> 172.26.12.250 80<br>
1511783436.987762 20<br>
-   Link           req 2 rxreq<br>
-   SessClose      REM_CLOSE 0.217<br>
-   End<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
2017-11-27 20:21 GMT+09:00 Guillaume Quintard <<a href="mailto:guillaume@varnish-software.com">guillaume@varnish-software.<wbr>com</a>>:<br>
> Hi,<br>
><br>
> I would expect to have two AE headers, one with aaa and one with bbb, would<br>
> you have the varnishlog of that particular bereq?<br>
><br>
> Also, it's probably out of scope, but are you actually changing the<br>
> Accept-Encoding header, or is that just for the example?<br>
><br>
> --<br>
> Guillaume Quintard<br>
><br>
> On Mon, Nov 27, 2017 at 12:15 PM, matrix <<a href="mailto:matrix@matrix2000.name">matrix@matrix2000.name</a>> wrote:<br>
>><br>
>> I would like to control bereq header below.(varnish4.1.8)<br>
>><br>
>> header.append(bereq.http.<wbr>Accept-Encoding, "aaa");<br>
>> header.append(bereq.http.<wbr>Accept-Encoding, "bbb");<br>
>><br>
>> But bereq.http.Accept-Encoding header is "aaa". (not "aaa,bbb")<br>
>> is it possible to handle the bereq using vmod_header ?<br>
>><br>
>> or is it varnish-modules bug?<br>
>><br>
>> Best regards.<br>
>> ______________________________<wbr>_________________<br>
>> varnish-misc mailing list<br>
>> <a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
>> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>