
straightflush at gmail
Apr 3, 2012, 6:25 AM
Views: 632
Permalink
|
|
Re: Re: URL rewrite with Varnish
|
|
You should be able to easily rewrite the req.http.header value in vcl_recv if (req.http.host == "mysite.domain.com") { set req.http.host = "10.0.0.10"; } To Rafal's point, this will pass the Host header of 10.0.0.10 to your backend. Make sure you backend is configured to be port 8888 backend default { .host = "127.0.0.1"; .port = "8888"; } On Tue, Apr 3, 2012 at 9:07 AM, James Light <j.gareth.light [at] gmail>wrote: > On Apr 3, 2012 8:53 AM, "RafaĆ Zawierta" <zawierta [at] gmail> wrote: > > > > Hello, > > > > Is it possible to handle such case: my webapp is running on > http://10.0.0.10:8888/content/site/EN.html and whole site is on base url: > http://10.0.0.10:8888/content/site/. > > > > I want to make my site available via Varnish on url: > http://mysite.mydomain.com/ - I want to remove whole stuff after / from > url. > > > > Rule: > > sub vcl_recv { > > if (req.http.host ~ "^(www\.)?mysite\.mydomain\.com$" ) { > > set req.url = regsub(req.url, "^/content/site/", "/"); > > } > > } > > > > isn't working at all. > > > > Regards > > R. > > > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc [at] varnish-cache > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > Is your backend configured to respond to requests to that hostname and > does it have a way to know that "/content/site" is aliased to "/" ? > Sorry if I'm missing something but it seems like a rewrite rule on the > backend is more appropriate for this sort of thing, no? > > _______________________________________________ > varnish-misc mailing list > varnish-misc [at] varnish-cache > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >
|