Encrypt the $remote_addr in log files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Encrypt the $remote_addr in log files

Dimitri Roschkowski
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 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


_______________________________________________
nginx mailing list
[hidden email]
http://nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt the $remote_addr in log files

Boris Dolgov
On Sat, Aug 28, 2010 at 2:39 PM, Dimitri Roschkowski <[hidden email]> 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 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 Dolgov.

_______________________________________________
nginx mailing list
[hidden email]
http://nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt the $remote_addr in log files

Maxim Dounin
In reply to this post by Dimitri Roschkowski
Hello!

On Sat, Aug 28, 2010 at 12:39:44PM +0200, Dimitri Roschkowski 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 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?

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 Dounin

_______________________________________________
nginx mailing list
[hidden email]
http://nginx.org/mailman/listinfo/nginx