From 0d4482c6e0263c7b9f555de643d131b2fa68faf2 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 7 Dec 2017 12:13:33 +0530 Subject: [PATCH] nginx.conf: document HTTPS redirection --- conf/nginx.conf | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c11d89b..47f726b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,11 +17,6 @@ location ~ /api/v[0-9]+/(users/)?websocket$ { location / { client_max_body_size 50M; - - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_set_header Connection ""; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; @@ -39,4 +34,8 @@ location / { #proxy_cache_use_stale timeout; #proxy_cache_lock on; proxy_pass http://127.0.0.1:8065; + # Yunohost addition: redirect HTTP to HTTPS + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } }