Wrong IP behind a proxy


(AngelWine) #1

Hi this is my first Inatllation, i use Version 2.4.1

I know you receive a lot of topic about PIWIK behind PROXY, and i read it.

BUT I’ts still not working for me

Here is my installation.

USE: Apache Proxy Server

LB - PROXY1 - PROX2 - PIWIK
HTTPS - HTTP -HTTP - HTTP

IP ADRESS of my components

10.126.25.40 = LB
10.126.25.34 = PROXY 1
10.126.35.34 = PROXY 2
10.126.45.44 = piwik

Here the Header who was received on piwik server

X-Forwarded-For: 192.168.200.193, 10.126.35.25
X-Forwarded-Host: intratst.xxx.xxx.ca, PROXY2.XXX.XXX.XXX
X-Forwarded-Server: intratst.xxx.xxx.ca, PROXY2.XXX.XXX.XXX
Connection: Keep-Alive

Here the config.ini.php

proxy_host_ips[] = 10.126.25.40
proxy_host_ips[] = 10.126.25.25
proxy_host_ips[] = 10.126.35.35
proxy_host_ips[] = 10.126.45.44
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST

All the stats are related to 10.126.25.25

if i COMMENT those lines from config.ini.php

;proxy_host_ips[] = 10.126.25.40
;proxy_host_ips[] = 10.126.25.25
;proxy_host_ips[] = 10.126.35.35
;proxy_host_ips[] = 10.126.45.44
;proxy_client_headers[] = HTTP_X_FORWARDED_FOR
;proxy_host_headers[] = HTTP_X_FORWARDED_HOST

All the stats are related to 10.100.35.35

What i Missed ?

Regards

Daniel


(Stefan Giehl) #2

Maybe your LB and/or Proxy are not configured correct.
Both need to pass through the clients IP address as HTTP_X_FORWARDED_FOR or similar, so that Piwik is able to track it.


(AngelWine) #3

Hi,

i finally found my problem.
In my configuration i had: (found it in a OLD POST !!!)
proxy_host_ips[] = … … … …

and the good parameter is

proxy_ips[] = … … … …

NOW it’s WORK! Thank’s :slight_smile: