Apache2 RemoteIP module returns 0.0.0.0 when RemoteIPHeader X-Forwarded-For is set

144 views Asked by At

The Apache is running behind Google HTTPS Proxy. Apache RemoteIP module is enabled which seems to work fine. Some requests are flagged in PHP code when Remote IP is 0.0.0.0. After investigation it is guessed that for some X-Forwarded-For IP list might have 0.0.0.0. Apache logs prints

LogFormat "%V:%p|%a|%{c}a|%{remoteip-proxy-ip-list}n|%{X-Forwarded-For}i|
%a is 0.0.0.0
%{c}a is 35.191.14.79
%{remoteip-proxy-ip-list}n is 35.191.14.79, 34.36.172.235, 193.1.150.232
%{X-Forwarded-For}i remains empty

It can happen only when X-Forwarded-For is set to 0.0.0.0, 193.1.150.232, 34.36.172.235, 35.191.14.79

I need to understand how it is possible? 193.1.150.232 looks like private address and Remote IP should stop parsing before it and set the remote IP as 34.36.172.235 and not 0.0.0.0 Further how it is possible to have origin of web request as 0.0.0.0?

0

There are 0 answers