Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Location resolution issue GeoiP database #22598

Closed
4 tasks done
kristoflarcher opened this issue Sep 18, 2024 · 1 comment
Closed
4 tasks done

[Bug] Location resolution issue GeoiP database #22598

kristoflarcher opened this issue Sep 18, 2024 · 1 comment
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member

Comments

@kristoflarcher
Copy link

kristoflarcher commented Sep 18, 2024

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

@kristoflarcher kristoflarcher added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Sep 18, 2024
@sgiehl
Copy link
Member

sgiehl commented Sep 18, 2024

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.

@sgiehl sgiehl closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member
Projects
None yet
Development

No branches or pull requests

2 participants