Bug #32341

$_SERVER['HTTPS'] vs. $_SERVER['HTTP_HTTPS'] nginx

Added by Norbert over 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Must have
Category:
Frontend
Target version:
-
Start date:
2011-12-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,

Typo3 looks for "$_SERVER['HTTPS']" but nginx "proxy_set_header HTTPS 1" set a "$_SERVER['HTTP_HTTPS']".

So i think typo3 have to check this in t3lib/class.t3lib_div.php on Line 4153:

$retVal = $_SERVER['SSL_SESSION_ID'] || !strcasecmp($_SERVER['HTTPS'], 'on') || !strcmp($_SERVER['HTTPS'], '1') ? TRUE : FALSE;

Solution:

$retVal = $_SERVER['SSL_SESSION_ID'] || (!strcasecmp($_SERVER['HTTPS'], 'on') || !strcmp($_SERVER['HTTPS'], '1')) && (!strcasecmp($_SERVER['HTTP_HTTPS'], 'on') || !strcmp($_SERVER['HTTP_HTTPS'], '1')) ? TRUE : FALSE;
Something like that, or a smaller solution. ;-)

Regards,


Related issues

Related to TYPO3 Core - Bug #29693: Respect HTTP_X_FORWARDED_PROTO in SSL checkRejectedMichael Stucki2011-09-12

Actions
Related to TYPO3 Core - Bug #81837: SSL mixed content issues in backend when HTTPS server var is not setClosed2017-07-11

Actions
Related to TYPO3 Core - Bug #86264: Trusted hosts pattern mismatch with Nginx and HTTP_X_FORWARDED_PORT 443Accepted2018-09-15

Actions

Also available in: Atom PDF