Closed kristoflarcher closed 1 month ago
Hey @kristoflarcher,
Actually Matomo by default uses the last IP in the list.
If you want to use the first IP instead you need to set proxy_ip_read_last_in_list = 0
in config.
Let us know if it still doesn't work as expected when using this config setting.
What happened?
Hi, We use Matomo 5.0.3, deployed on Gcloud under an external Loadbalancer.
Loadbalancer forwards these requests headers to Matomo: X-Forwarded-For: 217.111.180.226, 34.98.115.97, 35.191.40.112 X-Forwarded-Host: dev-certinot.credoc.be X-Forwarded-Port: 443 X-Forwarded-Prefix: /matomo X-Forwarded-Proto: https X-Forwarded-Server: web-gateway-f5d6f8dbd-zxqql X-Forwarded-Uri: /matomo X-Real-Ip: 35.191.40.112
The x-forward header contains multiple address : the real client address is the frist one of the list Anf from what i know, if Multiple IPs in X-forward-for header, Matomo should use the first one by default but it 'seem not to be the case
and i set Matomo php config as follow ( to exclude proxies addresses ) [General] enable_location = 1 proxy_uri_header = 1 proxy_client_headers[] = "HTTP_X_FORWARDED_FOR" proxy_host_ips[] = "35.191../16" proxy_host_ips[] = "34.98../16"
From the console it s taken in account: ./console config:get --section="General" --key="proxy_host_ips" response : ["35.191../16","34.98../16","34.98.115.97","35.191.40.124"]
Geoip Database has been pushed to misc ( the free version and is taken in account ): But i still get a location from United state using Geop IP, I am still located in USA , address for proxy it seems
Thanks
What should happen?
I dont know how to solve, how to get a resolution from this first addres from x-forward-for header.
How can this be reproduced?
for any Visit to our website, we get a location resolution that points USA ( matomo displays this IP : 35.191.0.0 for the user WHERE AS it has been included proxy_host_ips )
Matomo version
5.0.3
PHP version
8.2.18
Server operating system
No response
What browsers are you seeing the problem on?
Chrome
Computer operating system
Windows 11
Relevant log output
No response
Validations