From 6538bf55f8576ad598f7aaafe9d056cf7c06db82 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 24 Jul 2017 12:14:22 +0530 Subject: [PATCH] Force https I observed if we open monica.domain.tld it opens in http. To force https by default I added # Force https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } --- conf/nginx.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3bacff7..690c367 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,10 @@ location ^~ YNH_EXAMPLE_PATH { alias YNH_WWW_PATH; try_files $uri $uri/ @monica; index index.php; - + # Force https + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } location ~ \.php { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/run/php/php7.0-fpm.sock;