Location problems

We finally got Matomo going (thank you Lukas!), but still have a serious problem in the sense that it doesn’t determine the location of our visitors. Everybody seems to be located in San Jose, USA, and have the same IP address. As this location is the location of our server, we asked them if there was a problem on their side. the answer was pretty swift, and not so friendly.
"it appears that the original issue reported is related to a 3rd party application, for which we are unable to offer additional technical assistance"
So, has anybody any ideas how we can avoid the whole world population being located in San Jose?

f you are seeing the same IP for everyone it is likely there is a reverse proxy fronting your Matomo server. Try solutions from the following link. How do I configure Piwik when the server is installed behind a proxy? - Analytics Platform - Matomo

Can you provide the first half of the IP address? That would help diagnose the issue.

1 Like

the IP address begins with 198.38. and the location is given as San Jose, which is a long way away from Athens, Greece…

Host tells me that they do indeed use NGINX as a reverse proxy, and to use $_SERVER[‘HTTP_X_FORWARDED_FOR’]
to get the client IP.
So, where do I find nginx.conf to make the changes?
UPDATE: The host tells me that the changes suggested in the link given cannot/will not be made. If we want this to work, then the changes need to be made in the application itself…


The changes linked shouldn’t need the help of your host. You just need to edit the config/config.ini.php.

This is what the Matomo “Help” file tells me

  1. configure your web server to provide a header HTTP_X_FORWARDED_URI. For example on NGINX, when Matomo (Piwik) is installed in /piwik path, you would set proxy_set_header X-Forwarded-Uri /piwik; in your nginx.conf.
    2( [General]
    ; Use the header HTTP_X_FORWARDED_URI to construct the current script name
    proxy_uri_header = 1

the second part involves the config.ini file, and is done, but we all still live in San Jose, USA… so what about the first part. If this does not involve the host, then either the help file is extremely confusing or I can’t read… Host tells me nginx.conf is out of bounds…

Or am I reading this all wrong?

You are right, but if you are indeed behind a reverse proxy and if this proxy doesn’t tell the original IP via HTTP_X_FORWARDED_URI (which they do most of the time), there no no way for PHP (and therefore Matomo) to know which IP the visitor has as it only sees the proxy.

Do all of your visitors have the same IP address when you view the vistor log?

yes, all vistors have the same IP.
Host tells me to use $_SERVER[‘HTTP_X_FORWARDED_FOR’], but I have no idea where to put it…


When you add

proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST

(pay atention, that there is no ; at the beginning)
to the [General] section of the config (as mentioned in the docs), Matomo will use $_SERVER[‘HTTP_X_FORWARDED_FOR’] internally.

Done that, doesn’t make any difference. w are all still in San Jose with the same IP…

Another idea:

Can you create an php file (example.php) like this


put it into your piwik folder and access it from the browser (https://piwik.yoursite.example/example.php).

It should show your IP-Adress (between other data).

yes, this gives me my IP address indeed
So I take it this means something in Matomo isn’t working properly as te server does return the correct IP address…