From ca9ac33c8ac8e6fa2c695e37af627e747a332999 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Tue, 09 Feb 2016 09:08:25 -0500
Subject: [PATCH] Fixed: Issue #3751 ISPConfig Login fails on Nginx servers in 3.1-dev version.
---
interface/lib/app.inc.php | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index e23b6ca..f9ef167 100755
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -71,6 +71,13 @@
$this->uses('session');
$sess_timeout = $this->conf('interface', 'session_timeout');
$cookie_domain = (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']);
+
+ // Workaround for Nginx servers
+ if($cookie_domain == '_') {
+ $tmp = explode(':',$_SERVER["HTTP_HOST"]);
+ $cookie_domain = $tmp[0];
+ unset($tmp);
+ }
$cookie_secure = ($_SERVER["HTTPS"] == 'on')?true:false;
if($sess_timeout) {
/* check if user wants to stay logged in */
--
Gitblit v1.9.1