From feafe46c182ca312739f07666b91f722035204e8 Mon Sep 17 00:00:00 2001 From: opi Date: Wed, 2 Aug 2017 14:13:41 +0200 Subject: [PATCH] Force redirection to https --- conf/nginx.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index cbe969e..097808f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,6 +2,11 @@ location PATHTOCHANGE/static/ { alias /opt/yunohost/ihatemoney/src/budget/static/; } location PATHTOCHANGE { + # Force https. + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; @@ -17,6 +22,6 @@ location PATHTOCHANGE { break; } - # Include SSOWAT user panel. + # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; }