Issue Bug Closed

#88846Install tool (on FIRST_INSTALL) warns about "Trusted hosts pattern mismatch" although 'trustedHostsPattern' is set correctly (if no LocalConfiguration.php is present)

Jonas Eberle 07/26/19, 09:56 updated 06/28/21, 02:52

Description

With a reverse proxy in a mixed http/https configuration like

browser <https> proxy <http> webserver

(this configuration can be easily reproduced in ddev where this is default)

the install tool gives a warning on installation. The warning can be ignored and the installation be continued by clicking on “Continue with errors”.
In fact this is not an error.

The warning is (obviously) not shown via http://

The warning is:

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

On first glance it seems that AdditionalConfiguration.php is not evaluated when NO LocalConfiguration.php is present.

Test files:

AdditionalConfiguration.php

<?php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*';

LocalConfiguration.php

if it does not exist, the warning is shown.
If it contains this, the warning is NOT shown:

<?php
return [];

Reviews 4