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; }