apache - Redirecting ssl naked to www with apache2, varnish and nginx -
i use varnish 4 @ port 80, apache2 @ 8080, , nginx proxy ssl @ 443. code used in /etc/varnish/default.vcl
sub vcl_recv { if ( (req.http.host ~ "^(?i)www.example.com" || req.http.host ~ "^(?i)example.com") && req.http.x-forwarded-proto !~ "(?i)https") { return (synth(750, "")); } } sub vcl_synth { if (resp.status == 750) { set resp.status = 301; set resp.http.location = "https://www.example.com" + req.url; return(deliver); } }
this redirect http https , non-www www, but
- https://example.com -> https://www.example.com not redirected
is there way in vcl file?
Comments
Post a Comment