Project

General

Profile

Actions

Bug #86264

open

Trusted hosts pattern mismatch with Nginx and HTTP_X_FORWARDED_PORT 443

Added by Peter Kraume over 5 years ago. Updated about 4 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Backend API
Start date:
2018-09-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When the frontend is called via https, there is this error message in the log:

PHP Fatal error:  Uncaught UnexpectedValueException: The current host header value does not match the configured trusted hosts pattern! Check the pattern defined in $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] and adapt it, if you want to allow the current host header 'ddev105.ddev.local' for your installation. in /var/www/html/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php:2803" 

Install Tools says:

The trusted hosts pattern will be configured to allow all header values. This is because your $SERVER_NAME:[defaultPort] is "ddev105.ddev.local:443" while your HTTP_HOST:SERVER_PORT is "ddev105.ddev.local:80". Check the pattern defined in Admin Tools -> Settings -> Configure Installation-Wide Options -> System -> trustedHostsPattern and adapt it to expected host value(s).

The problem seems to be that the DDEV configuration has no extra SSL configuration and thus there is a mismatch between SERVER_PORT and HTTP_X_FORWARDED_PORT which needs an additional check.

Test environment:
  • DDEV 1.2.0
  • TYPO3 9.4 composer based

Files

HTTP_X_FORWARDED_PORT.png (102 KB) HTTP_X_FORWARDED_PORT.png Peter Kraume, 2018-09-15 16:03

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #86265: No redirect to install tool on fresh installation with FIRST_INSTALL presentClosedBenni Mack2018-09-15

Actions
Related to TYPO3 Core - Bug #32341: $_SERVER['HTTPS'] vs. $_SERVER['HTTP_HTTPS'] nginxClosedMichael Stucki2011-12-06

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

Actions
Actions

Also available in: Atom PDF