<div dir="ltr">Hello Axel & Maxim,<div><br></div><div>I have modified the apache log format as below</div><div><br></div>LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" common<div>
<br></div><div>and get the source IP at /var/log/apache/access.log </div><div><br></div><div>I wonder if I there is any scope to add more info in the common log as it is a production server. And also need the same for ErrorLog too.</div>
<div><br></div><div>Any suggestion ?</div><div><br></div><div>Thanks<br><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 28, 2014 at 7:25 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<div><div class="h5"><br>
On Mon, Apr 28, 2014 at 07:03:28PM +0530, Joydeep Bakshi wrote:<br>
<br>
> Hello list,<br>
><br>
> To get the wan IP in apache log I have already enabl mod_rapf in opensude<br>
> server.<br>
><br>
> # a2enmod rpaf mod_rpaf<br>
> "rpaf" already present<br>
><br>
> a2enmod mod_rpaf<br>
> "mod_rpaf" already present<br>
><br>
> Here is a nginx vhost section for passing IP to apache log<br>
><br>
> [......]<br>
> proxy_redirect off; # Do not redirect this proxy - It needs to be<br>
> pass-through<br>
> proxy_set_header Host $host;<br>
> proxy_set_header X-Real-IP $remote_addr;<br>
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>
> proxy_set_header X-Server-Address $server_addr;<br>
> proxy_pass_header Set-Cookie;<br>
> [......]<br>
><br>
> After restarting both apache and nginx, the apache log for that specific<br>
> vhost still showing 127.0.0.1 as source IP at apache log.<br>
><br>
> Am I missing something ?<br>
<br>
</div></div>Most notably, you've missed configuration of mod_rpaf. It needs<br>
to be enabled in configuration, and you have to at least configure<br>
IP address it will accept headers from, as well as a header to<br>
look into.<br>
<br>
<a href="http://www.stderr.net/apache/rpaf/" target="_blank">http://www.stderr.net/apache/rpaf/</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" target="_blank">http://nginx.org/</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>