diff --git a/app/init.php b/app/init.php index 6a89340247..5a6a4b91c0 100644 --- a/app/init.php +++ b/app/init.php @@ -43,7 +43,8 @@ $collections = include __DIR__.'/../app/config/collections.php'; // OAuth provid $redisHost = $request->getServer('_APP_REDIS_HOST', ''); $redisPort = $request->getServer('_APP_REDIS_PORT', ''); $utopia = new App('Asia/Tel_Aviv', $env); -$port = (string) parse_url($request->getServer('HTTP_HOST', ''), PHP_URL_PORT); +$scheme = $request->getServer('REQUEST_SCHEME', ''); +$port = (string) parse_url($scheme.'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_PORT); Resque::setBackend($redisHost.':'.$redisPort); @@ -53,7 +54,7 @@ define('COOKIE_DOMAIN', $request->getServer('HTTP_HOST', null) === 'localhost:'.$port ) ? null - : '.'.parse_url($request->getServer('HTTP_HOST', ''), PHP_URL_HOST)); + : '.'.parse_url($scheme.'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_HOST)); define('COOKIE_SAMESITE', null); // Response::COOKIE_SAMESITE_NONE /*