Commits

Mikhail Korobov  committed 8d6e4a3

permanent redirect from www.domain.com to domain.com in default nginx config

  • Participants
  • Parent commits 1f36811

Comments (0)

Files changed (1)

File fab_deploy/config_templates/nginx.config

 server {
     listen 80;
-    server_name {{ SERVER_NAME }} www.{{ SERVER_NAME }};
+    server_name {{ SERVER_NAME }};
     access_log /var/log/nginx/{{ INSTANCE_NAME }}.access.log;
     charset utf-8;
     client_max_body_size 8m;
         root   /var/www/nginx-default;
     }
 }
+
+server {
+    listen 80;
+    server_name www.{{ SERVER_NAME }};
+    rewrite ^(.*)$ http://{{ SERVER_NAME }}$1 permanent;
+}