summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/ampache.cfg.php.dist4
-rw-r--r--lib/init.php2
2 files changed, 5 insertions, 1 deletions
diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist
index fce5218f..e51a3c5e 100644
--- a/config/ampache.cfg.php.dist
+++ b/config/ampache.cfg.php.dist
@@ -551,6 +551,10 @@ use_rss = true
;proxy_user = ""
;proxy_pass = ""
+; If Ampache is behind an https reverse proxy, force use HTTPS protocol.
+;Default: false
+;force_ssl = true
+
;#############################
; Mail Settings #
;#############################
diff --git a/lib/init.php b/lib/init.php
index 9c7adfe1..eae9a1fd 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -49,7 +49,7 @@ Config::set('prefix',$prefix);
/*
Check to see if this is http or https
*/
-if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
+if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || Config::get('force_ssl') == true) {
$http_type = "https://";
}
else {