Url rewrite con Varnish

La configurazione si trova nel file /etc/varnish/default.vcl :

backend default {

.host = “127.0.0.1”;

.port = “8080“;

}

sub vcl_recv {

        if (req.url == “/”) {

        error 750 “http://”+req.http.host+”/NUOVO_URL”;

        }

}

sub vcl_error {

if (obj.status == 750) {

set obj.http.Location = obj.response;

set obj.status = 302;

return(deliver);

}

}

sub vcl_fetch {

if (beresp.http.cache-control ~ “(no-cache|private)” ||

beresp.http.pragma ~ “no-cache”) {

set beresp.ttl = 0s;

}

}

© 2024 Catfish Blog | Tema: Storto di CrestaProject WordPress Themes.