Bug #103959
closedTYPO3 fresh installation in DDEV routing context fails on Trusted Hosts Pattern Mismatch
100%
Description
When using the TYPO3 GIT Core repository via DDEV, and installing it web-based for the first time, the installation fails with the dreaded "Trusted Hosts Pattern Mismatch" error when using the https:// protocol.
This is documented in the TYPO3 Contribution Guide as a sidenote:
If you are getting a trustedHostsPattern error on initial access, try accessing the HTTP domain first.
The actual error message from TYPO3 reads:
The trusted hosts pattern will be configured to allow all header values.
This is because your $SERVER_NAME:$SERVER_PORT is
"test-installer.ddev.site:80" while your HTTP_HOST is "test-installer.ddev.site".
Check the pattern defined in Admin Tools -> Settings -> Configure
Installation-Wide Options -> System -> trustedHostsPattern and adapt it to expected host value(s).
When a developer like me reads this, they might be included to fix this with "AdditionalConfiguration.php" or "additional.php", but that fails, because both these files are NOT evaluated during installation in legacy mode.
The actual solution is to use "http://" for installation.
To improve the DX/UX for this kind of installation, the error message should be enhanced to point this out.
Note that issues https://forge.typo3.org/issues/88846 and https://forge.typo3.org/issues/86356 also stumbled on this; the solution in TYPO3 9.x at the time was to allow reading AdditionalConfiguration.php on the installation already, if it existed. In newer TYPO3 versions this seems to have been reverted though, as this is no longer the case.