Just to clarify, the mentiond PR is for display the real client's IP address (not just 127.0.0.1) if a reverse proxy is in between.
That's working good, see:
Please have a look at that script file, most (if not all) of the functions in there are not needed for the login page.
Maybe some of these values are not needed in the login page, but I think the issue will also happen in other pages if the value of advancedInfoSource.data("xff") is undefined.