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

is there way in vcl file?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -