<div dir="ltr">You should be able to accomplish this with restarts (the wayezpublish does it: <a href="https://github.com/ezsystems/ezpublish-community/blob/master/doc/varnish/vcl/varnish4.vcl">https://github.com/ezsystems/ezpublish-community/blob/master/doc/varnish/vcl/varnish4.vcl</a>), or you can use vmod-curl.</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 Thu, Mar 2, 2017 at 10:18 AM, Donath, Niklas <span dir="ltr"><<a href="mailto:Niklas.Donath@lvdigital.de" target="_blank">Niklas.Donath@lvdigital.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="white" lang="DE" link="#0563C1" vlink="#954F72">
<div class="m_5537194048480762307WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Hi there,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">i am currently trying to put varnish in front of a restful webservice with an existing http digest authentication.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Does anyone already had this use case and could give me a hint or an example code on how to set this up properly?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I didn’t find useful information in the varnish docs. The e-book “Getting started with Varnish Cache” only scratches that topic.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Examples I found about basic authentication do not really match because the authentication is implemented on varnish side only.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I would like to pass through the authentication to the backend because I don’t want to add user handling in varnish itself.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">In my understanding, the authentication works as follows:<u></u><u></u></span></p>
<p class="m_5537194048480762307MsoListParagraph"><u></u><span lang="EN-US" style="font-size:11.0pt"><span>-<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u><span dir="LTR"></span><span lang="EN-US" style="font-size:11.0pt">1<sup>st</sup> request: no authentication, passed to the backend, backend response with nonce in header<u></u><u></u></span></p>
<p class="m_5537194048480762307MsoListParagraph"><u></u><span lang="EN-US" style="font-size:11.0pt"><span>-<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u><span dir="LTR"></span><span lang="EN-US" style="font-size:11.0pt">2<sup>nd</sup> request: client sends user credentials, passed to the backend, server gives proof (200) or fail (401)<u></u><u></u></span></p>
<p class="m_5537194048480762307MsoListParagraph"><u></u><span lang="EN-US" style="font-size:11.0pt"><span>-<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u><span dir="LTR"></span><span lang="EN-US" style="font-size:11.0pt">3<sup>rd</sup> request: probably cache hit, request with auth credentials is “forked” as HEAD request, sent to the backend, server gives proof (200) or fail (401)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Am I getting this right, am I probably missing something?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Thank you in advance for any input and/or feedback!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Greetings,<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></span></p><span class="HOEnZb"><font color="#888888">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Niklas<u></u><u></u></span></p>
</font></span></div>
</div>
<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></blockquote></div><br></div>