# Encrypt the $remote\_addr in log files

**URL:** <https://www.ruby-forum.com/t/encrypt-the-remote-addr-in-log-files/194027>\
**Category:** NGINX\
**Created:** [August 28, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/encrypt-the-remote-addr-in-log-files/194027 "2010-08-28T12:40:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitri\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@Dimitri\_R](https://www.ruby-forum.com/u/Dimitri_R)\
**Post date:** [August 28, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/encrypt-the-remote-addr-in-log-files/194027/1 "2010-08-28T12:40:53Z")

</div>

Hi, I want to give the user of my websites more privacy. Well â€“ I just  
need the logs for debugging and some statistics. So I donâ€™t need to save  
the real users IP address, but I need some kind of identifier string to  
separate users (like I do with IP addresses now). My idea is to just run  
md5 on the IP address, so I get a unique string for every IP address.

On the [http://wiki.nginx.org/NginxHttpLogModule](http://wiki.nginx.org/NginxHttpLogModule) LogModule page in the  
Nginx Wiki I couldnâ€™t find all variables, I can use in the log files. So  
is there a build in feature to encrypt the IP address or do I have to  
write my own (small) module to get this feature?

– Dimitri

---

<div class="post-metadata">

**Author:** ![Dimitri\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@Dimitri\_R](https://www.ruby-forum.com/u/Dimitri_R)\
**Post date:** [August 28, 2010, 12:49pm UTC](https://www.ruby-forum.com/t/encrypt-the-remote-addr-in-log-files/194027/2 "2010-08-28T12:49:05Z")

</div>

On Sat, Aug 28, 2010 at 2:39 PM, Dimitri R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi, I want to give the user of my websites more privacy. Well – I just need  
> the logs for debugging and some statistics. So I don’t need to save the real  
> users IP address, but I need some kind of identifier string to separate  
> users (like I do with IP addresses now). My idea is to just run md5 on the  
> IP address, so I get a unique string for every IP address.
> 
> On the [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/NginxHttpLogModule) LogModule page in the Nginx  
> Wiki I couldn’t find all variables, I can use in the log files. So is there  
> a build in feature to encrypt the IP address or do I have to write my own  
> (small) module to get this feature?  
> You can use built-in perl to hash variables.

–  
Boris D..

---

<div class="post-metadata">

**Author:** ![Dimitri\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@Dimitri\_R](https://www.ruby-forum.com/u/Dimitri_R)\
**Post date:** [August 29, 2010, 1:11am UTC](https://www.ruby-forum.com/t/encrypt-the-remote-addr-in-log-files/194027/3 "2010-08-29T01:11:54Z")

</div>

Hello!

On Sat, Aug 28, 2010 at 12:39:44PM +0200, Dimitri R. wrote:

> do I have to write my own (small) module to get this feature?  
> In log files you may use all variables from all modules. But  
> there is no one with md5 of $remote\_addr.

With embedded perl module you may use perl\_set to produce  
apropriate variable. Though it would be probably better to write  
simple module instead if you don’t already have embedded perl in  
your nginx for other reasons.

Maxim D.
