I am currently having some success with the Reverse Proxying features of Varnish, and the only thing left that I need to be able to do is essentially rewrite some of the URL's in the body.<div><br></div><div>For example, we have a url internally that might be <a href="http://wp1.rupaz.com">wp1.rupaz.com</a> and we need the url's in the HTML page to be rewritten to <a href="http://www.rupaz.com/blogs">http://www.rupaz.com/blogs</a><br clear="all">
<br></div><div>Right now I am kind of stuck but I am assuming I should be doing something similar to following? I have not idea which beresp object I should use for the body of the content since there is no documentation.</div>
<div><br></div><div><div><br></div><div> sub vcl_fetch {</div><div> </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if (req.http.host == "<a href="http://www.rupaz.com">www.rupaz.com</a>" && req.url ~ "^/blogs"){</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>set beresp = regsuball(beresp, "^<a href="http://wp1.rupaz.com">wp1.rupaz.com</a>", "<a href="http://www.rupaz.com/forums">www.rupaz.com/forums</a>");</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return(deliver);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div>
<div> if (!beresp.cacheable) {</div><div> return (pass);</div><div> }</div><div> if (beresp.http.Set-Cookie) {</div><div> return (pass);</div><div> }</div><div> return (deliver);</div><div>
}</div><div> </div></div><div><br>______________________________<br><br>Harry Yeh<br>CEO / CTO<br>Rupaz<br><span class="Apple-style-span" style="font-family: Arial, Helvetica, 'Nimbus Sans L', sans-serif; font-size: 13px; border-collapse: collapse; line-height: 15px; "><a href="http://twitter.com/rupaztweet" target="_blank">Twitter</a></span><br>
<div><div><div><span style="font-size:13px;border-collapse:collapse"><div><font face="Arial, Helvetica, 'Nimbus Sans L', sans-serif"><span style="line-height:15px"><a href="http://www.facebook.com/pages/Rupaz/175747085776028" target="_blank">Facebook</a></span></font></div>
</span></div><div>When you think <a href="http://www.rupaz.com/" target="_blank">thong</a>, think <a href="http://www.rupaz.com/" target="_blank">Rupaz</a>!</div><div><br></div><div>Web: <a href="http://www.ooolalashop.com/" target="_blank">http://www.rupaz.com</a><br>
Me: <a href="http://www.linkedin.com/in/harryyeh" target="_blank">http://www.linkedin.com/in/harryyeh</a> <br>Twitter: <a href="http://twitter.com/harryyeh" target="_blank">http://twitter.com/harryyeh</a><br>Confidentiality Notice:<br>
<br>This electronic mail transmission and any accompanying attachments contain confidential information intended only for the use of the individual or entity named above. Any dissemination, distribution, copying or action taken in reliance on the contents of this communication by anyone other than the intended recipient is strictly prohibited. If you have received this communication in error please immediately delete the E-mail and notify the sender at the above E-mail address.</div>
</div></div><br>
</div>