[TYPO3-core] trustedHostsPattern
JoH asenau
info at cybercraft.de
Fri May 23 15:20:55 CEST 2014
Am 23.05.2014 13:13, schrieb Helmut Hummel:
> Hi Joey,
>
> On 22.05.14 15:20, JoH asenau wrote:
>
>> After upgrading the TYPO3 sources we ran into "Exception thrown without
>> a stack frame blah" without any additional info.
>
> Can you post the exact exception message please?
>
> Was it "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 \'' . $retVal .
> '\' for your installation." ?
It was exactly that: Exception thrown without a stack frame in Unknown
on line 0
>> Frontend and backend are running on NGINX behind an NGINX based HA-Proxy
>> and the domains are configured to be running on different ports than
>> default.
>> So the default setting SERVER_NAME just broke any TYPO3 instance
>> completely and we just found out by accident, what the problem is.
>>
>> The "accident" was a redirect which is activated for URLs without a
>> trailing slash and it redirects from
>
> I want to understand this case in order to provide a better handling if
> possible.
>
>> blah.domain.com/typo3
>>
>> to
>>
>> blah.domain.tld:12345/typo3/
>>
>> The latter was running smoothly, which lead us to the actual problem.
>
> Where does the redirect happen? Is there a server running on the default
> porton blah.domain.com? Must be, as only then a redirect can be
> established.
The redirect is done on the actual server side.
Nginx has a rewrite rule checking for missing trailing slashes and
redirecting them.
Since there is already a known port in that case, it redirects to
domain.com:12345/typo3/
> You are saying blah.domain.tld:12345/typo3/ worked with the default
> TYPO3 setting SERVER_NAME?
Yes it did, since in this case server name and port matched the incoming
values, I guess.
> In any case, I would be interested in the following vars in the TYPO3
> environment(s):
>
> print_r(array_intersect_key($_SERVER,
> array('HTTP_HOST'=>'','SERVER_NAME'=>'','SERVER_PORT'=>'','REQUEST_URI'=>'','HTTPS'=>'','REMOTE_ADDR'=>'')));
HTTP_HOST
redaktion.domain.tld
SERVER_NAME
redaktion.domain.tld
SERVER_PORT
17101
REQUEST_URI
/typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
REMOTE_ADDR
10.91.65.199
no HTTPS
> var_dump($GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyIP']);
> var_dump($GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxySSL']);
> var_dump(t3lib_div::getIndpEnv('TYPO3_SSL'));
reverseProxyIP
reverseProxySSL
TYPO3_SSL
all empty.
HTH
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
More information about the TYPO3-team-core
mailing list