<div dir="ltr">Hi,<div><br></div><div>You can. Alternatively, if the SSL terminator is sending traffic to varnish via another port, you can unconditionally hash the listening port:</div><div><br></div><div>hash_data(std.port(server.ip));</div><div><br></div><div>(don't forget to import std first)<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 13, 2018 at 10:16 AM Miguel Gonzalez <<a href="mailto:miguel_3_gonzalez@yahoo.es">miguel_3_gonzalez@yahoo.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_-4734816472558339054ydp1c1f04c8yahoo-style-wrap" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px"><div></div>
<div>I use Varnish 4.1, can I just add in the vcl_hash this?</div><div><br></div><div><span><table class="gmail-m_-4734816472558339054ydp9fb0c0b1highlight gmail-m_-4734816472558339054ydp9fb0c0b1tab-size gmail-m_-4734816472558339054ydp9fb0c0b1js-file-line-container" style="border-collapse:collapse;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><tbody><tr><td id="gmail-m_-4734816472558339054ydp9fb0c0b1LC236" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-code gmail-m_-4734816472558339054ydp9fb0c0b1blob-code-inner gmail-m_-4734816472558339054ydp9fb0c0b1js-file-line gmail-m_-4734816472558339054ydp9fb0c0b1highlighted" style="padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"> <span class="gmail-m_-4734816472558339054ydp9fb0c0b1pl-c" style="color:rgb(106,115,125)"># Cache the HTTP vs HTTPs separately</span></td></tr><tr><td id="gmail-m_-4734816472558339054ydp9fb0c0b1L237" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-num gmail-m_-4734816472558339054ydp9fb0c0b1js-line-number" style="padding:0px 10px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;line-height:20px;min-width:50px;text-align:right;vertical-align:top;white-space:nowrap;width:50px"></td><td id="gmail-m_-4734816472558339054ydp9fb0c0b1LC237" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-code gmail-m_-4734816472558339054ydp9fb0c0b1blob-code-inner gmail-m_-4734816472558339054ydp9fb0c0b1js-file-line gmail-m_-4734816472558339054ydp9fb0c0b1highlighted" style="padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"> <span class="gmail-m_-4734816472558339054ydp9fb0c0b1pl-k" style="color:rgb(215,58,73)">if</span> (<span class="gmail-m_-4734816472558339054ydp9fb0c0b1pl-smi">req.http.X-Forwarded-Proto</span>) {</td></tr><tr><td id="gmail-m_-4734816472558339054ydp9fb0c0b1L238" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-num gmail-m_-4734816472558339054ydp9fb0c0b1js-line-number" style="padding:0px 10px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;line-height:20px;min-width:50px;text-align:right;vertical-align:top;white-space:nowrap;width:50px"></td><td id="gmail-m_-4734816472558339054ydp9fb0c0b1LC238" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-code gmail-m_-4734816472558339054ydp9fb0c0b1blob-code-inner gmail-m_-4734816472558339054ydp9fb0c0b1js-file-line gmail-m_-4734816472558339054ydp9fb0c0b1highlighted" style="padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"> <span class="gmail-m_-4734816472558339054ydp9fb0c0b1pl-c1" style="color:rgb(0,92,197)">hash_data</span>(<span class="gmail-m_-4734816472558339054ydp9fb0c0b1pl-smi">req.http.X-Forwarded-Proto</span>);</td></tr><tr><td id="gmail-m_-4734816472558339054ydp9fb0c0b1L239" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-num gmail-m_-4734816472558339054ydp9fb0c0b1js-line-number" style="padding:0px 10px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;line-height:20px;min-width:50px;text-align:right;vertical-align:top;white-space:nowrap;width:50px"></td><td id="gmail-m_-4734816472558339054ydp9fb0c0b1LC239" class="gmail-m_-4734816472558339054ydp9fb0c0b1blob-code gmail-m_-4734816472558339054ydp9fb0c0b1blob-code-inner gmail-m_-4734816472558339054ydp9fb0c0b1js-file-line" style="padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap"> }</td></tr></tbody></table></span> <br></div><div><br></div><div><br></div><div><br></div><div><br></div>
</div><div id="gmail-m_-4734816472558339054ydp37f055edyahoo_quoted_5332362940" class="gmail-m_-4734816472558339054ydp37f055edyahoo_quoted">
<div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
<div>
En jueves, 13 de diciembre de 2018 10:05:20 CET, Mattias Geniar <<a href="mailto:mattias@nucleus.be" target="_blank">mattias@nucleus.be</a>> escribió:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">> Here you have it:<br clear="none"><br clear="none">You are not caching the protocol (http or https), which will lead to different caching results depending on the backend response.<br clear="none"><br clear="none">As an example, have a look here: <a shape="rect" href="https://github.com/mattiasgeniar/varnish-6.0-configuration-templates/blob/master/default.vcl#L236-L238" rel="nofollow" target="_blank">https://github.com/mattiasgeniar/varnish-6.0-configuration-templates/blob/master/default.vcl#L236-L238 </a><br clear="none"><br clear="none">In your Apache proxy config you can set additional headers to mark they've been passed through it (in this example, X-Forwarded-Proto) so Varnish knows to treat them differently.<div class="gmail-m_-4734816472558339054ydp37f055edyqt9105582370" id="gmail-m_-4734816472558339054ydp37f055edyqtfd13769"><br clear="none"><br clear="none">Mattias<br clear="none"><br clear="none"></div></div></div>
</div>
</div></div>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">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/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote></div>