summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormomo-i <webmaster@momo-i.org>2011-02-01 07:16:22 +0900
committermomo-i <webmaster@momo-i.org>2011-02-01 07:16:22 +0900
commit245400143dc2398d395d2482e2dc4e904313b1d4 (patch)
tree893740252c648ee0fdbd6dd64cc852128797b610
parent4e354f5e31b8dbd0624a59e8e04e5e8eb3d67699 (diff)
downloadampache-245400143dc2398d395d2482e2dc4e904313b1d4.tar.gz
ampache-245400143dc2398d395d2482e2dc4e904313b1d4.tar.bz2
ampache-245400143dc2398d395d2482e2dc4e904313b1d4.zip
add force_ssl (for ssl reverse proxy)
-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 {