You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have noticed a couple of sites on one of our hosts running into an issue where the getRequestingIp() function is returning a local address '127.0.0.1' rather than the client IP, it looks to be related to inconsistencies between the values stored in $_SERVER, maybe if a proxy is used:
I initially addressed CloudFlare hosting environments but Patrol is being used in many more environments now and we definitely need to figure out how to support proxies, Heroku/Fortrabbit style environments, etc.
I've had limited time to work on my plugins lately and I know it's holding a few people back in some cases.
- Fix issue #12 where the requesting IP could not be determined if behind some proxies
- Fix critical issue where Patrol would explode on sites without a proper baseUrl set
- Updated default value of baseUrl to `app.request.hostInfo`
- Updated documentation for baseUrl
> Thank you, Simon Davies and Chris Rowe for your feedback and PRs
Hi Selvin,
We have noticed a couple of sites on one of our hosts running into an issue where the
getRequestingIp()
function is returning a local address '127.0.0.1' rather than the client IP, it looks to be related to inconsistencies between the values stored in $_SERVER, maybe if a proxy is used:https://github.com/selvinortiz/craft-plugin-patrol/blob/6728e1996c7df4cdf49482841e01cce1f7728149/src/services/PatrolService.php#L286
It looks as though our server (with kyup on cloudways) reports the correct ip in both
$_SERVER['HTTP_X_FORWARDED_FOR']
and$_SERVER['HTTP_X_REAL_IP']
.There looks to be a load of different approaches out there, not sure which is the most reliable.
Thanks,
Sam
The text was updated successfully, but these errors were encountered: