Upgrade to Matomo 5 brought back internal IPs

I’m running Matomo in Kubernetes (K3S) with the default Traefik ingress. All the visits are logged as having the container IP (10.42..). I fixed it in Matomo 4 by adding:

proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_ips[] = "192.168.*.*/16"
proxy_ips[] = "10.*.*.*/8"
proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"

I also followed a post on upgrading to Matomo 5 and added:

proxy_ip_read_last_in_list = 0

But I’m still stuck with the 10.42.. IPs. Has anyone else solved this?

Did you also reapply the other proxy settings (client headers)? It seems, unfortunately, that all proxy settings are reset / lost when upgrading from 4.x to 5.x.

See https://matomo.org/faq/how-to-install/faq_98/

1 Like

I did… Didn’t help unfortunately.

For debugging, if possible, create a PHP scsript in the Matomo root folder with the content:

<?php

var_dump($_SERVER);

And call it from the “outside”. Then, you’ll see a lot of different attributes of the server request. Probably, you’ll be able to see a hint on what’s missing/wrong (e.g no forwarded-for header, or it has another name, or the proxy IPs are different, etc.)

1 Like

Great tip!

All of the IP headers are wrong…

HTTP_X_FORWARDED_FOR
REMOTE_ADDR

So this is not a Matomo issue, it’s a Traefik issue.

Thanks for your help!

1 Like