Skip to content

Instantly share code, notes, and snippets.

@nilnilnil
Created August 29, 2013 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilnilnil/6383186 to your computer and use it in GitHub Desktop.
Save nilnilnil/6383186 to your computer and use it in GitHub Desktop.
redact client ip from nginx error log
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index c8c5d15..a3f1953 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -3472,7 +3472,7 @@ ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len)
ctx = log->data;
- p = ngx_snprintf(buf, len, ", client: %V", &ctx->connection->addr_text);
+ p = ngx_snprintf(buf, len, ", client: REDACTED");
len -= p - buf;
r = ctx->request;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment