heiks
July 16, 2012, 2:55pm
1
Hello !
I’ve been struggling with that for a few hours now…
I’m using nginx + fastcgi (php-fpm).
Everything works fine, except it seems like it can’t resolve the client IP address.
Instead, it just display 0.0.0.0 in the dashboard.
I tried to change several stuff in my nginx configuration but still can’t make it work.
I’m sure I’m missing something super easy… but what ?
Any help would be appreciated!
matthieu
(Matthieu Aubry)
July 17, 2012, 3:41am
2
please see: Installation - Analytics Platform - Matomo
try adding all lines to your config files (uncommented)
heiks
July 17, 2012, 9:16am
3
Hello,
Thank you but I already tried that…
I tried to had a phpinfo() page and the remote address is well passed.
Plus, in the dashboard, the ISP is properly guessed. Which means piwik gets the IP address, but still displays 0.0.0.0
Do you have another idea ?
Regards !
matthieu
(Matthieu Aubry)
July 17, 2012, 9:31am
4
If piwik displays 0 it shows the IP is not recorded correctly - please check in the log_visit table for the location_ip field?
heiks
July 17, 2012, 9:48am
5
Done!
Looks like an encoding problem ?!
±------------+
| location_ip |
±------------+
| X{ˆÃ |
| X{ˆÃ |
| X{ˆÃ |
| X{ˆÃ |
I don’t get it…
matthieu
(Matthieu Aubry)
July 20, 2012, 1:26am
8
try <?php var_dump($_SERVER);
in a test.php file
is the IP in a _SERVER value?
heiks
July 20, 2012, 8:10am
9
if I got right your question: no.
My IP shows up in REMOTE_ADDR
[“REMOTE_ADDR”]=> string(14) “my ip address” [“REMOTE_PORT”]=> string(5) “53446”
Is that what you meant ?
matthieu
(Matthieu Aubry)
July 22, 2012, 5:38am
10
Piwik looks in REMOTE_ADDR to get the IP so maybe try to remove the proxy config from your config.ini.php ?
it should work
heiks
July 23, 2012, 6:46pm
11
There’s not particular config about proxy in my config.ini.php.
And, sorry if I wasn’t clear enough: REMOTE_ADDR IS the right IP address (the client one, not the server one).
That’s what I meant by “my IP address”.
When u asked me to look what was stored in the database, did u see my answer?
It looks like an encoding problem or something
heiks
July 25, 2012, 8:40am
13
mysql> SELECT INET_NTOA(location_ip) from piwik_log_visit;
±-----------------------+
| INET_NTOA(location_ip) |
±-----------------------+
| 0.0.0.0 |
| 0.0.0.0 |
| 0.0.0.0 |
| 0.0.0.0 |
So, no. It’s not an encoding problem.
Any other idea ?
Gmck
July 26, 2012, 2:22am
14
Sounds like You need to install the nginx real ip module. Are you behind a load balancer?
You need to map the ip to the correct php var in nginx configs.
See Module ngx_http_realip_module
heiks
August 2, 2012, 6:48am
15
Hello Gmck,
Thanks for your help but I’m not behind a loadbalancer and it’s only not working with Piwik.
As I showed previously in this thread, the IP address seemed to be well passed by nginx (please see the part with the phpinfo() ).
Anything else ?
Regards,
Gmck
August 2, 2012, 5:09pm
16
Please attach your nginx.conf, php-fpm.com (and any other fpm conf files) & php.ini files. I can only speculate without seeing the conf files.
heiks
August 13, 2012, 2:41pm
17
Hello,
Sorry for the delay. I’ve been pretty busy the past few days.
You can find the files you asked for at the following:
http://pastebin.com/LM3864iW
Let me know if u need anything else.
Regards,
Gmck
September 11, 2012, 2:32pm
20
There is nothing in the config files that jumps out as being a problem. If your web server logs are showing the client IP address, then it’s happening at the javascript level where Piwik is not getting the IP passed to it.