From 0d69e15eded0be4f80fb7ff2c15186178d4cf19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20F=C3=A9lizard?= Date: Tue, 9 Feb 2016 18:21:18 +0000 Subject: [PATCH] Clean up whitespaces and group sections semantically No functional changes --- data/templates/nginx/server.conf.sed | 12 ++++++------ data/templates/nginx/yunohost_admin.conf | 10 ++++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/data/templates/nginx/server.conf.sed b/data/templates/nginx/server.conf.sed index 656a1d80e..acd82d177 100644 --- a/data/templates/nginx/server.conf.sed +++ b/data/templates/nginx/server.conf.sed @@ -2,7 +2,7 @@ server { listen 80; listen [::]:80; server_name {{ domain }}; - + access_by_lua_file /usr/share/ssowat/access.lua; include conf.d/{{ domain }}.d/*.conf; @@ -19,23 +19,23 @@ server { listen 443 ssl; listen [::]:443 ssl; server_name {{ domain }}; - ssl_certificate /etc/yunohost/certs/{{ domain }}/crt.pem; - ssl_certificate_key /etc/yunohost/certs/{{ domain }}/key.pem; + ssl_certificate /etc/yunohost/certs/{{ domain }}/crt.pem; + ssl_certificate_key /etc/yunohost/certs/{{ domain }}/key.pem; ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!3DES:+HIGH:+MEDIUM; + add_header Strict-Transport-Security "max-age=31536000;"; - + # Uncomment the following directive after DH generation # > openssl dhparam -out /etc/ssl/private/dh2048.pem -outform PEM -2 2048 - #ssl_dhparam /etc/ssl/private/dh2048.pem; access_by_lua_file /usr/share/ssowat/access.lua; - + include conf.d/{{ domain }}.d/*.conf; include conf.d/yunohost_admin.conf.inc; diff --git a/data/templates/nginx/yunohost_admin.conf b/data/templates/nginx/yunohost_admin.conf index 0f208cb59..722a0dfee 100644 --- a/data/templates/nginx/yunohost_admin.conf +++ b/data/templates/nginx/yunohost_admin.conf @@ -1,25 +1,30 @@ server { listen 80 default_server; listen [::]:80 default_server; + location / { rewrite ^ https://$http_host/yunohost/admin permanent; } + location /yunohost/admin { rewrite ^ https://$http_host$request_uri? permanent; } } + server { listen 443 ssl default_server; listen [::]:443 ssl default_server; - ssl_certificate /etc/yunohost/certs/yunohost.org/crt.pem; + + ssl_certificate /etc/yunohost/certs/yunohost.org/crt.pem; ssl_certificate_key /etc/yunohost/certs/yunohost.org/key.pem; ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!3DES:+HIGH:+MEDIUM; + add_header Strict-Transport-Security "max-age=31536000;"; - + location / { rewrite ^ https://$http_host/yunohost/admin permanent; } @@ -30,6 +35,7 @@ server { return 403; } } + include conf.d/yunohost_admin.conf.inc; include conf.d/yunohost_api.conf.inc; }