If redirect from http to https is need and there is no success via .htaccess then PHP can help us:
'…lib/tpl/template-name/main.php'
if ($_SERVER['HTTP_HOST'] != 'localhost' and $_SERVER['HTTP_X_FORWARDED_PROTO'] != "https") { $location = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; exit; }
Inspired by https://www.dokuwiki.org/tips:httpslogin