Matomo behind loadbalancer and CloudFront reports the wrong public port

Matomo is used behind a load balancer (AWS) with dedicated port and CloudFront (AWS). The Matomo installation is running on docker (matomo:latest) and uses internally port 80. External port for load balancer is port 6000 - that’s the port CloudFront uses too to communicate with the load balancer. General public URL is standard 443 For some resources (logo uploaded) and within the tracker-info we have the wrong info like - how can we override/set standard URL?

Fixed it with a simple, but for sure not beautiful solution, based on - so we added in main /var/www/html a .htaccess file, added the following line:

php_value auto_prepend_file change_hostinfo.php

then we created a change_hostinfo.php with the following content:


And the problem was solved. Again, not nice, but does the trick.

1 Like