<div dir="ltr">Hello,<br>We have varnish-2.0.6 on CentOS 5.5 in front of Apache & drupal, and we tried to map the domain ww.xx.yy.zz to a drupal URI, like /websites/a/b/c, so any one can hit ww.xx.yy.zz directly insted of wiritng ww.xx.yy.zz/websites/a/b/c.<br>
it works fine for the first time, but the next time i hit the same URL, it directs me to the main page of drupal, not to the URI, and i should delete all my temp files to get it to work again.<br><br>here's the config file:<br>
<br>backend default {<br> .host = "127.0.0.1";<br> .port = "8080";<br>}<br>sub vcl_recv {<br><br> if (req.request != "GET" &&<br> req.request != "HEAD" &&<br>
req.request != "PUT" &&<br> req.request != "POST" &&<br> req.request != "TRACE" &&<br> req.request != "OPTIONS" &&<br> req.request != "DELETE") {<br>
return (pipe);<br> }<br><br> if (req.request != "GET" && req.request != "HEAD") {<br> return (pass);<br> }<br> if (req.http.Authorization || req.http.Cookie) {<br> return (pass);<br>
}<br><br> if (req.http.host ~ "^ww\.xx\.yy\.zz$") {<br> set req.url =
"/websites/a/b/c/";<br> }<br> return (lookup);<br>}<br>sub vcl_pipe {<br> return (pipe);<br>}<br>sub vcl_pass {<br> return (pass);<br>}<br>sub vcl_hash {<br> set req.hash += req.url;<br> if (req.http.host) {<br>
set req.hash += req.http.host;<br> } else {<br> set req.hash += server.ip;<br> }<br> return (hash);<br>}<br>sub vcl_hit {<br> if (!obj.cacheable) {<br> return (pass);<br> }<br> return (deliver);<br>
}<br>sub vcl_miss {<br> return (fetch);<br>}<br>sub vcl_fetch {<br> if (!obj.cacheable) {<br> return (pass);<br> }<br> if (obj.http.Set-Cookie) {<br> return (pass);<br> }<br> set obj.prefetch = -30s;<br>
return (deliver);<br>}<br>sub vcl_deliver {<br> return (deliver);<br>}<br>sub vcl_discard {<br> return (discard);<br>}<br>sub vcl_prefetch {<br> return (fetch);<br>}<br>sub vcl_timeout {<br> return (discard);<br>
}<br>sub vcl_error {<br> set obj.http.Content-Type = "text/html; charset=utf-8";<br> synthetic {"<br><?xml version="1.0" encoding="utf-8"?><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br>
"<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"><br><html><br> <head><br> <title>"} obj.status " " obj.response {"</title><br>
</head><br> <body><br> <h1>Error "} obj.status " " obj.response {"</h1><br> <p>"} obj.response {"</p><br> <h3>Guru Meditation:</h3><br>
<p>XID: "} req.xid {"</p><br> <hr><br> <address><br> <a href="<a href="http://www.varnish-cache.org/">http://www.varnish-cache.org/</a>">Varnish cache server</a><br>
</address><br> </body><br></html><br>"};<br> return (deliver);<br>}<br><br><br>//JJ<br><br>
</div>