Jonathan Matthews contact at jpluscplusm.com
Thu Jun 28 21:54:40 UTC 2012

Resurrecting an old thread ...

On 18 July 2011 10:07, Gábor Farkas <gabor at nekomancer.net> wrote:
> hi,
> i need something like
> http://httpd.apache.org/docs/current/mod/mod_unique_id.html (but for
> nginx obviously).
> basically i need nginx to generate some kind of
> uuid/checksum/something-unique, that it can send to an
> upstream-proxied server,
> and also put into the logs. the idea is to be able to track the
> 'lifetime' of a request as it traverses through nginx and into the
> upstream server and then back into nginx.

I had exactly this idea too :-) I'm wondering if anyone has any input?

Some random thoughts:

I'd like to *avoid* using embedded LUA/Perl/etc, even though they have
libraries that might do the actual (UU)ID generation. This is because,
as the OP suggests, having this header inserted at the most external
entry point to your network means you can track the request most
completely across your infrastructure. On my external nginx instances
(SSL-terminating, for example) I *really* like to keep the enabled
modules as light as possible to decrease the machine's attack surface.

Linux exposes /proc/sys/kernel/random/uuid, which does the heavy
lifting for us of generating a (UU)ID. Windows ... probably doesn't

Is anyone doing anything like this? Am I missing a simple way of
achieving the goal of injecting (relatively) unique IDs into my N-tier
proxy_pass'd architecture?

Jonathan Matthews
Oxford, London, UK

More information about the nginx mailing list