From 9701f894756785598807899a8d615119cfaeb955 Mon Sep 17 00:00:00 2001 From: Oskar Pearson Date: Sat, 28 Mar 2015 19:44:53 +0000 Subject: [PATCH] [www_redirect_use_base_domain] Redirect to www.{{nginx_base_domain} If nginx_server_name is www.example.com, if someone goes to http://example.com/ they should be redirected to http://www.example.com/ - not http://www.www.example.com --- templates/nginx_sites-available.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/nginx_sites-available.conf.j2 b/templates/nginx_sites-available.conf.j2 index 722971b..901c3c7 100644 --- a/templates/nginx_sites-available.conf.j2 +++ b/templates/nginx_sites-available.conf.j2 @@ -14,7 +14,7 @@ map $scheme $sts { server { listen {{ nginx_listen }}; server_name {{ nginx_base_domain }}; - return 301 $scheme://www.{{ nginx_server_name }}$request_uri; + return 301 $scheme://www.{{ nginx_base_domain }}$request_uri; } {% endif %}