apache - Varnish 4 rewrite URL transparently -


i looking after website running pretty standard varnish/apache set up. client needs add new domain transparently serves path/query string in order create lightweight version of site. example:

the user visits mobile.example.com points same server example.com

varnish rewrites mobile.example.com request example.com/mobile?theme=mobile

user receives page served example.com/mobile?theme=mobile apache, stays on mobile.example.com

we need hit both path , add query string here, maintain path user has entered, i.e: mobile.example.com/test should serve content @ example.com/mobile/test?theme=mobile

any tips doing varnish 4? possible?

got working!

if (req.http.host ~ "^mobile\.example\.com") {   set req.http.host = "example.com";   set req.url = regsub(req.url, "^/", "/mobile/");   set req.url = regsub(req.url, "$", "?theme=mobile"); }  

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -