To respect the privacy of my users I\'m trying to anonymize their IP addresses in nginx log files.
One way to do this would be defining a custom log format, like so:<
Here's an nginx module that basically does this (anonymizing IP addresses in your logs): https://github.com/masonicboom/ipscrub. It generates a hash of the IP address as $remote_addr_ipscrub. The hash salt cycles every so often (configurable), so you can link requests without logging user IP addresses.