<div dir="ltr">Hi Tim,<div><br></div><div>The problem is you need to escape the question mark in the regex like this: </div><div><br></div><div>"^\?oa_social_login_source=custom$"<br></div><div><br></div><div>The question maker is a regex special character meaning "match the previous character one or zero times.  That doesn't really work with the start of line character.</div><div><br></div><div>You can see this compiling here</div><div><br></div><div><a href="http://www.vclfiddle.net/150816-1e0353b/3">http://www.vclfiddle.net/150816-1e0353b/3</a><br></div><div><br></div><div>As a side note, the req.url will include the slash at the start if people put in this url</div><div><br></div><div><a href="http://beta.jokefire.com/">http://beta.jokefire.com/</a><span style="font-size:12.8px">?oa_social_login_source=</span><span style="font-size:12.8px">custom</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">which would be entirely valid, could I suggest something like this:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">"^/?\?oa_social_login_source=custom$"</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Glenn</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 August 2015 at 14:01, Tim Dunphy <span dir="ltr"><<a href="mailto:bluethundr@gmail.com" target="_blank">bluethundr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div>Hey guys,</div><div><br></div><div> I'm trying to allow logins on my site. So I setup the following in my VCL under varnish 4:</div><div><br></div><div><div># Allow the beta site to login</div><div>   if ( req.http.host ~ "^beta\.jokefire\.com$" && req.url ~ "^?oa_social_login_source=custom$" ) {</div><div>      return (pass);</div><div>   }</div></div><div><br></div><div>But when I go to do a syntax check on the VCL I get the following error:</div><div><br></div><div><div>#varnishd -C -f default.vcl</div><div>Message from VCC-compiler:</div><div>Regexp compilation error:</div><div><br></div><div>nothing to repeat</div><div><br></div><div>('input' Line 111 Pos 62)</div><div>   if ( req.http.host ~ "^beta\.jokefire\.com$" && req.url ~ "^?oa_social_login_source=custom$" ) {</div><div>-------------------------------------------------------------##################################----</div><div><br></div><div>Running VCC-compiler failed, exited with 2</div><div><br></div><div>VCL compilation failed</div></div><div><br></div><div><br></div><div>Could I get a little help with the syntax to get this working?</div><div><br></div><div>Thanks,</div><div>Tim</div><span class="HOEnZb"><font color="#888888">-- <br><div>GPG me!!<br><br>gpg --keyserver <a href="http://pool.sks-keyservers.net" target="_blank">pool.sks-keyservers.net</a> --recv-keys F186197B<br><br></div>
</font></span></div>
<br>_______________________________________________<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/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><b style="color:rgb(136,136,136)">Glenn Slaven</b><br><div style="color:rgb(136,136,136)">Principal Engineer</div><div style="color:rgb(136,136,136)"><br></div><div style="color:rgb(136,136,136)">Ph: (02) 9119 0444</div><div style="color:rgb(136,136,136)">M: 0433 826 255</div><div style="color:rgb(136,136,136)"><a href="http://www.squixa.com/" style="color:rgb(17,85,204)" target="_blank">www.squixa.com</a></div><div style="color:rgb(136,136,136)"><img src="http://www.squixa.com/media/wysiwyg/squixa%20_logo_150x46.png"></div></div></div>
</div>