Skip to content

Logs showing localhost (127.0.0.1) instead of HTTP_X_FORWARDED_FOR when using a proxy to ISPconfig

Summary

When using a proxy Vhost in front of the ISPconfig control panel, the logs shows;

Successful login for user 'username' from 127.0.0.1 at 2023-12-11 19:17:16 with session ID <randomID>

Steps to reproduce

  1. Create a Vhost that proxies the :8080 ISPconfig
  2. Login via the proxied version
  3. Watch /var/log/ispconfig/auth.log

Correct behaviour

It should show the following;

Successful login for user 'username' from X.X.X.X at 2023-12-11 19:17:16 with session ID <randomID>, where X.X.X.X is the real IP.

Environment

Server OS + version: Debian 11
ISPConfig version: 3.2.11p1

Proposed fix

Use $_SERVER['HTTP_X_FORWARDED_FOR'] when set.

Edited by Tim de Boer