Skip to content

Instantly share code, notes, and snippets.

@cocoy
Created July 6, 2011 08:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocoy/1066823 to your computer and use it in GitHub Desktop.
Save cocoy/1066823 to your computer and use it in GitHub Desktop.
nginx log format get clientIP behind ELB.
log_format proxied_combined '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log logdir/access.log proxied_combined;
@jnankin
Copy link

jnankin commented Jan 2, 2014

is there a way to get error_log to use http_x_forwarded_for as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment