Apache 1.3 + mod_proxy -> Client-IP nicht immer definiert
Posted: 2006-11-08 08:56
Gegeben:
Proxy-Server:
- Apache 1.3
- Module:
- Weitergeleitet wird per (inkl. dyn vHosts):
Webserver hinter dem Proxy:
- Apache 1.3
- Module:
- Zusätzliche geladen:
Fehlerbeschreibung:
Grundsätzlich übermittelt der Proxy die Client-IP in HTTP_X_FORWARDED_FOR ohne Probleme. Aber eben nur grundsätzlich.
Zum testen habe ich folgendes LogFormat definiert:
Rufe ich nun eine PHP-Datei auf, dann wird die IP korrekt übergeben:
Und nun kommts: rufe ich eine HTML-Datei auf, krieg ich folgenden Log-Eintrag:
Gleiches Problem tritt bei 404ern, 403ern auf - irgendjemand eine Idee?
Proxy-Server:
- Apache 1.3
- Module:
Code: Select all
Compiled-in modules:
http_core.c
mod_log_config.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_dir.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_proxy.cCode: Select all
RewriteEngine On
RewriteRule ^/(.*)$ http://%{HTTP_HOST}/$1 [P,L]- Apache 1.3
- Module:
Code: Select all
Compiled-in modules:
http_core.c
mod_log_config.c
mod_mime.c
mod_status.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_actions.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_proxy.c
mod_so.cCode: Select all
mod_sqlinclude
mod_choke
mod_php5Grundsätzlich übermittelt der Proxy die Client-IP in HTTP_X_FORWARDED_FOR ohne Probleme. Aber eben nur grundsätzlich.
Zum testen habe ich folgendes LogFormat definiert:
Code: Select all
LogFormat "Remote-Host: %a HTTP_X_FORWARDED_FOR: %{HTTP_X_FORWARDED_FOR}e HTTP_X_FORWARDED_HOST: %{HTTP_X_FORWARDED_HOST}e %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" testCode: Select all
Remote-Host: 1.1.1.54 HTTP_X_FORWARDED_FOR: 10.0.0.2 HTTP_X_FORWARDED_HOST: host.tld - - [08/Nov/2006:08:38:17 +0100] "GET /phpinfo.php HTTP/1.1" 200 2536 "-" "xyz - UserAgent"Code: Select all
Remote-Host: 1.1.1.54 HTTP_X_FORWARDED_FOR: - HTTP_X_FORWARDED_HOST: - - - [08/Nov/2006:08:54:45 +0100] "GET /test.html HTTP/1.1" 200 21 "-" xyz - UserAgent"