Fixing backend URLs
Michael Alger
varnish at mm.quex.org
Fri Sep 24 06:35:15 CEST 2010
On Fri, Sep 24, 2010 at 11:21:18AM +0700, Dang Tung wrote:
>
> It's not work for me, may be my configurations are wrong, could anyone help
> me please. Here's my configuration:
>
> sub vcl_fetch {
> if (!beresp.cacheable) {
> return (pass);
> }
> if (beresp.http.Set-Cookie) {
> return (pass);
> }
> return (deliver);
Here you are returning from vcl_fetch(), so the following code will
never be executed. You should move that return statement to be the
last in the function.
> if (beresp.status == 301 || beresp.status == 302)
> {
> set beresp.http.Location = regsub(beresp.http.Location, "^(\w+://[^/]+):\d+", "\1");
> }
> }
More information about the varnish-misc
mailing list