[Varnish] non-www yonlendirmesi

Varnish ile www yonlendirmesi asagidaki gibidir. Kisaca murat.ws adresini www.murat.ws adresine otomatik olarak yonlendirir. Varnish 4.0 icindir. sub vcl_recv { if (req.http.host ~ “^murat.ws”) { return (synth (750, “”)); } } sub vcl_synth { if (resp.status == 750) { set resp.status = 301; set resp.http.Location = “http://www.murat.ws” + req.url; return(deliver); } } https://www.varnish-cache.org/trac/wiki/VCLExampleRedirectInVCL

Continue reading