I wonder if it's possible to exclude specific query parameters in the URI from being logged to the Nginx access log?
Here's our current configuration:
log_format main '$remote_addr - $remote_user [$time_local] $host "$request" ' '$status $body_bytes_sent $request_time "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
Regardless of the request path, let's say I want the "latitude" parameter to be excluded from being logged (or preferably, it should be obfuscated). I know I can exclude all query parameters by changing "$request" to e.g. "$request_method $uri", but then I lose all parameters which is not what I want.
GET /index.html?latitude=43.4321&otherkey=value HTTP/1.1 to be obfuscated to something like this:
GET /index.html?latitude=******&otherkey=value HTTP/1.1