php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62243 Incorrect IP address when using reverse proxy
Submitted: 2012-06-06 14:47 UTC Modified: 2013-02-18 00:35 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: wong at mollie dot nl Assigned: patrickallaert (profile)
Status: No Feedback Package: APM (PECL)
PHP Version: 5.3.13 OS: linux-debian-squeeze64
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wong at mollie dot nl
New email:
PHP Version: OS:

 

 [2012-06-06 14:47 UTC] wong at mollie dot nl
Description:
------------
The stored Remote IP address in the `event`.`ip` column is incorrect, if Apache 
is running behind a reverse proxy like nginx. 

The value should equal the $_SERVER['REMOTE_ADDR'] value in long-format.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-07 07:06 UTC] wong at mollie dot nl
This is more of a bug since PHP does get it right, where APM does not.
 [2012-06-07 07:06 UTC] wong at mollie dot nl
-Type: Feature/Change Request +Type: Bug
 [2012-06-18 21:28 UTC] patrickallaert@php.net
-Assigned To: +Assigned To: patrickallaert
 [2012-06-18 22:28 UTC] patrickallaert@php.net
It is very unlikely that $_SERVER['REMOTE_ADDR'] contains the IP address of the 
client when behind a proxy (without specific manipulation in userland or with 
the help of an extension).

Normally, in such case one should inspect $_SERVER['HTTP_X_FORWARD_FOR'].

In all cases, APM actually stores the content of $_SERVER['REMOTE_ADDR'].

What I can do is inspecting $_SERVER['HTTP_X_FORWARD_FOR'] first and use this 
one if filled.

Does this suggestion suites your needs?
 [2012-06-18 22:29 UTC] patrickallaert@php.net
-Status: Assigned +Status: Feedback
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC