From f0efe96dd4e492dfdb2108f0b9ce35b41f1dc4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uherkovich=20P=C3=A9ter?= Date: Sun, 8 Nov 2020 00:11:42 +0100 Subject: [PATCH] reverse proxy port problem --- index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.php b/index.php index 0614540..d71345f 100644 --- a/index.php +++ b/index.php @@ -28,6 +28,9 @@ define('SAML_INTERNAL', 1); +// If we are behind a reverse proxy which terminates ssl and converts port to another, this line prevents bad redirections +if(isset($_SERVER['HTTP_X_FORWARDED_PORT'])) $_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT']; + try { // In order to avoid session problems we first do the SAML issues and then // we log in and register the attributes of user, but we need to read the value of the $CFG->dataroot.