x-forwarded-for ip in server access logs

Yordan Georgiev y.georgiev at gmail.com
Wed Feb 27 09:08:54 MSK 2008


set   X-Forwarded-For  $add_x_forwarded_for;
use $add_x_forwarded_for for log_format and any configure options

On Tue, Feb 26, 2008 at 11:41 PM, rkmr.em at gmail.com <rkmr.em at gmail.com>
wrote:

> how do i get the x-forwarded-for ip address in server access logs?
> i tried this log format in the server section, but i still get the default
> logs
>
> how to fix this?
> thanks
>
>
>    server {
>        listen       8070;
>        server_name  .XX.com;
>        log_format  main  '$remote_addr - $remote_user [$time_local]
> $request '  '"$status" $body_bytes_sent "$http_referer"'
> '"$http_user_agent" "$http_x_forwarded_for"'   '"$gzip_ratio"
> "$upstream_status" "$upstream_response_time" "$upstream_addr"';
>        access_log  logs/access_pop.log;
>        error_log  logs/error_pop.log;
>        location / {
>            root   /home/mark/work/pop;
>            fastcgi_pass backend_pop;
>            include /home/mark/work/infrastructure/nginx_fastcgi.conf;
>        }
>   }
>
>


Please excuse my bad english...

С уважение,
Й. Георгиев.

WEB: http://gigavolt-bg.net/
Blog:  http://live.gigavolt-bg.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080227/438d6291/attachment.html>


More information about the nginx mailing list