x-forwarded-for ip in server access logs

rkmr.em at gmail.com rkmr.em at gmail.com
Wed Feb 27 00:41:14 MSK 2008


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;
        }
   }





More information about the nginx mailing list