[Koha-bugs] [Bug 23068] Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 9 03:36:11 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23068

--- Comment #52 from David Cook <dcook at prosentient.com.au> ---
(In reply to David Cook from comment #50)
> Trying to remember why we needed this since in theory
> Plack::Middleware::ReverseProxy should've handled this...

Ahh I see now. Plack::Middleware::ReverseProxy chooses the last IP in the list
(rather than the first), so if you're using a reverse proxy in front of Koha's
Apache reverse proxy, then you'll get the IP address for that reverse proxy
instead of the client IP address. 

I guess I can understand that... since it is the most recent IP address to
connect... and then we use Koha::Middleware::RealIP (inspired by
Plack::Middleware::RealIP) to validate the proxy addresses and get the real
client IP...

--

I can get the client IP via $ENV{REMOTE_ADDR} in Koha as set by
Koha::Middleware::RealIP, but plack.log is still using the proxy address as set
by Plack::Middleware::ReverseProxy. (I've confirmed that by hacking on
Plack::Middleware::ReverseProxy.pm in k-t-d.)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list