Use config site/sslproxy to force HTTPS (i.e. using reverse proxy to enable it)
Usage in config.php: $config['site']['sslproxy'] = true; Add this to documentation...
This commit is contained in:
parent
ec257d940a
commit
a61235086b
|
@ -266,10 +266,8 @@ function main()
|
||||||
|
|
||||||
$args = $r->map($path);
|
$args = $r->map($path);
|
||||||
|
|
||||||
$site_ssl = common_config('site', 'ssl');
|
|
||||||
|
|
||||||
// If the request is HTTP and it should be HTTPS...
|
// If the request is HTTP and it should be HTTPS...
|
||||||
if ($site_ssl != 'never' && !GNUsocial::isHTTPS() && common_is_sensitive($args['action'])) {
|
if (GNUsocial::useHTTPS() && !GNUsocial::isHTTPS()) {
|
||||||
common_redirect(common_local_url($args['action'], $args));
|
common_redirect(common_local_url($args['action'], $args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ $default =
|
||||||
'inviteonly' => true,
|
'inviteonly' => true,
|
||||||
'private' => false,
|
'private' => false,
|
||||||
'ssl' => 'never',
|
'ssl' => 'never',
|
||||||
|
'sslproxy' => false, // set to true to force GNU social to think it is HTTPS (i.e. using reverse proxy to enable it)
|
||||||
'sslserver' => null,
|
'sslserver' => null,
|
||||||
'dupelimit' => 60, // default for same person saying the same thing
|
'dupelimit' => 60, // default for same person saying the same thing
|
||||||
'textlimit' => 1000, // in chars; 0 == no limit
|
'textlimit' => 1000, // in chars; 0 == no limit
|
||||||
|
|
|
@ -426,6 +426,10 @@ class GNUsocial
|
||||||
|
|
||||||
static function isHTTPS()
|
static function isHTTPS()
|
||||||
{
|
{
|
||||||
|
if (common_config('site', 'sslproxy')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// There are some exceptions to this; add them here!
|
// There are some exceptions to this; add them here!
|
||||||
if (empty($_SERVER['HTTPS'])) {
|
if (empty($_SERVER['HTTPS'])) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user