Mixed Content Problem with TYPO3, Kubernetes and a docker apache image

6/14/2019

We have a running TYPO3 9.5.7 System on a kubernetes Cluster. TYPO3 runs on a docker container with PHP7.3-apache. The complete site has an SSL (Let's Encrypt) certificate. I can load the TYPO3 Backend. Now, if I try to activate an extension with the extensionmanager I got the following error:

Mixed Content: The page at 'https://my.domain.com/typo3/index.php?route=%2Fmain&token=b264e888080675e401a2a6162a9e7be22f968b7e' was loaded over HTTPS, but requested an insecure resource 'http://my.domain.com/typo3/index.php?route=%2Ftools%2FExtensionmanagerExtensionmanager%2F&token=8ab8e4a2eef2832bf7ff4615b9787642cadc6e01&tx_extensionmanager_tools_extensionmanagerextensionmanager%5BextensionKey%5D=of_customisation&tx_extensionmanager_tools_extensionmanagerextensionmanager%5Baction%5D=unresolvedDependencies&tx_extensionmanager_tools_extensionmanagerextensionmanager%5Bcontroller%5D=List'. This request has been blocked; the content must be served over HTTPS.

Has anyone an idea what I have to do to get rid of this error?

Thanks in advance

-- Raidri
apache
docker
kubernetes
typo3
typo3-9.x

1 Answer

6/14/2019

You should let TYPO3 know that it runs behind a HTTPS reverse proxy in your LocalConfiguration.php:

'SYS' => [
    'reverseProxyIP' => 'THE IP OF YOUR PROXY SERVER',
    'reverseProxyHeaderMultiValue' => 'last',
    'reverseProxySSL' => '*',
],

See the list of options on this topic in the TYPO3 source:

  • reverseProxyIP: List of IP addresses. If TYPO3 is behind one or more (intransparent) reverse proxies the IP addresses must be added here.
  • reverseProxyHeaderMultiValue: Defines which values of a proxy header (eg HTTP_X_FORWARDED_FOR) to use, if more than one is found.
  • reverseProxyPrefix: Optional prefix to be added to the internal URL (SCRIPT_NAME and REQUEST_URI).
  • reverseProxySSL: '*' or list of IP addresses of proxies that use SSL (https) for the connection to the client, but an unencrypted connection (http) to the server. If '*' all proxies defined in [SYS][reverseProxyIP] use SSL.
  • reverseProxyPrefixSSL: Prefix to be added to the internal URL (SCRIPT_NAME and REQUEST_URI) when accessing the server via an SSL proxy. This setting overrides [SYS][reverseProxyPrefix].
-- Mathias Brodala
Source: StackOverflow