From 589eee502626bacea1d775af9e1075445abe01aa Mon Sep 17 00:00:00 2001 From: saibotk Date: Mon, 29 Jul 2019 03:16:06 +0200 Subject: [PATCH] fix nginx config --- services/http/nginx.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/http/nginx.conf b/services/http/nginx.conf index 41f3578..8d95fa7 100644 --- a/services/http/nginx.conf +++ b/services/http/nginx.conf @@ -38,7 +38,13 @@ http { error_log /var/log/nginx/pterodactyl.app-error.log error; # Redirect to https - if ($http_x_forwarded_proto != false && $http_x_forwarded_proto != "https") { + if ($http_x_forwarded_proto != "https") { + set $shouldRedirectToHTTPS 1; + } + if ($http_x_forwarded_proto == false) { + set $shouldRedirectToHTTPS 0; + } + if ($shouldRedirectToHTTPS = 1) { return 301 https://$host$request_uri; }