Add a switch to force 'assume SSL' mode behind a reverse proxy, when the RP adds SSL and the internal connection is HTTP only.
This commit is contained in:
parent
cf84f82eae
commit
546980249e
3 changed files with 4 additions and 1 deletions
|
@ -31,6 +31,7 @@ class Application_Common_HTTPHelper
|
|||
$baseUrl = $CC_CONFIG['baseUrl'];
|
||||
$baseDir = $CC_CONFIG['baseDir'];
|
||||
$basePort = $CC_CONFIG['basePort'];
|
||||
$forceSSL = $CC_CONFIG['forceSSL'];
|
||||
if (empty($baseDir)) {
|
||||
$baseDir = "/";
|
||||
}
|
||||
|
@ -42,7 +43,7 @@ class Application_Common_HTTPHelper
|
|||
}
|
||||
|
||||
$scheme = "http";
|
||||
if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
|
||||
if ($forceSSL || ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')) {
|
||||
$scheme = "https";
|
||||
$basePort = "443"; //Airtime Pro compatibility hack
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ class Config {
|
|||
$CC_CONFIG['basePort'] = $values['general']['base_port'];
|
||||
$CC_CONFIG['stationId'] = $values['general']['station_id'];
|
||||
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
|
||||
$CC_CONFIG['forceSSL'] = isset($values['general']['force_ssl']) ? $values['general']['force_ssl'] : FALSE;
|
||||
if (isset($values['general']['dev_env'])) {
|
||||
$CC_CONFIG['dev_env'] = $values['general']['dev_env'];
|
||||
} else {
|
||||
|
|
|
@ -53,6 +53,7 @@ web_server_user = www-data
|
|||
base_url = localhost
|
||||
base_port = 80
|
||||
base_dir = /
|
||||
force_ssl =
|
||||
cache_ahead_hours = 1
|
||||
airtime_dir =
|
||||
station_id =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue