Varnish 3 does in fact a string concatenation character, "+", as per: <a href="https://www.varnish-cache.org/docs/3.0/installation/upgrade.html">https://www.varnish-cache.org/docs/3.0/installation/upgrade.html</a><br clear="all">
<div><i><br></i></div><i>-Zachary</i><br><br><div class="gmail_quote">On Wed, Mar 28, 2012 at 12:40 PM, Paul A. Procacci <span dir="ltr"><<a href="mailto:pprocacci@datapipe.com">pprocacci@datapipe.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think to concat strings you need a '+' sign between them.<br>
You should also escape your '.' periods in your regex's.<br>
<br>
~Paul<br>
<div><div class="h5"><br>
On Wed, Mar 28, 2012 at 11:15:58PM +0700, Nguyen Long wrote:<br>
> I used the vcl code to redirect website to mobile version as follow<br>
><br>
> sub vcl_recv {<br>
> if ((req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~<br>
> "Android" || req.http.User-Agent ~ "Symbian" || req.http.User-Agent ~<br>
> "^BlackBerry" || req.http.User-Agent ~ "^SonyEricsson" ||<br>
> req.http.User-Agent ~ "^Nokia" || req.http.User-Agent ~ "^SAMSUNG" ||<br>
> req.http.User-Agent ~ "^LG" || req.http.User-Agent ~ "webOS" ||<br>
> req.http.User-Agent ~ "^PalmSource") && req.http.host ~ "^(<a href="http://www.vechai.info" target="_blank">www.vechai.info</a>|<br>
> <a href="http://vechai.info" target="_blank">vechai.info</a>)") {<br>
> error 750 "Moved Temporarily";<br>
> }<br>
> }<br>
><br>
> sub vcl_error {<br>
> if (obj.status == 750) {<br>
> set obj.http.Location = "<a href="http://domain.com" target="_blank">http://domain.com</a>" req.url;<br>
> set obj.status = 302;<br>
> return(deliver);<br>
> }<br>
> }<br>
><br>
> But when I use above code on Centos has kernel version is Linux<br>
> localhost.localdomain 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST<br>
> 2011 x86_64 x86_64 x86_64 GNU/Linux then every things is ok.<br>
> But when I use bove code on Centos has kernel version is Linux<br>
> <a href="http://server6.vina84.com" target="_blank">server6.vina84.com</a> 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012<br>
> x86_64 x86_64 x86_64 GNU/Linux then fail :(<br>
> Both OS updated latest version.<br>
><br>
> Error as follow:<br>
> Message from VCC-compiler:<br>
> Expected ';' got 'req.url'<br>
> (program line 174), at<br>
> ('input' Line 121 Pos 64)<br>
> set obj.http.Location = "<a href="http://domain.com" target="_blank">http://domain.com</a>" req.url;<br>
> ---------------------------------------------------------------#######-<br>
><br>
> Running VCC-compiler failed, exit 1<br>
> VCL compilation failed<br>
> Command failed with error code 106<br>
><br>
> And when I change "set obj.http.Location = "<a href="http://domain.com" target="_blank">http://domain.com</a>" req.url;"<br>
> to " set obj.http.Location = "<a href="http://domain.com" target="_blank">http://domain.com</a>";" then varnish is aleady<br>
> running.<br>
<br>
</div></div>> _______________________________________________<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" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
<br>
________________________________<br>
<br>
This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See <a href="http://www.datapipe.com/legal/email_disclaimer/" target="_blank">http://www.datapipe.com/legal/email_disclaimer/</a> for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.<br>
<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" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote></div><br>