1

We run your default apache behind nginx setup.

This means that as far as the ip that shows up in the apache error logs is the nginx lan ip (eg: 192.168.0.X).

This means that the standard error log looks as follow (for a 404 error for example):

[Thu Nov 24 01:14:15 2011] [error] [client 192.168.0.X] File does not exist: /somefile.html

We are piping over the 'real ip' of the client via:

proxy_set_header        X-Real-IP       $remote_addr;

On the nginx side.

We would like this 'real ip' to show up in our error log.

I have done some searching and have not been able to find a way to customize the error log for apache.

Any ideas on how to get X-Real-IP to show up in the error_log?

anonymous-one
  • 14,454
  • 18
  • 60
  • 84

1 Answers1

0

You need to add mod rpaf to apache when apache is used behind a reverse proxy to log the real ip.

You can get it here: http://stderr.net/apache/rpaf/

You still need to pass the real ip as you are doing.

Dayo
  • 12,413
  • 5
  • 52
  • 67