Welcome! Log In Create A New Profile

Advanced

unique_id

Gábor Farkas
July 18, 2011 05:08AM
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.

currently i'm using an approach where i generate it in the
upstream-server, and then send it back to nginx in the response
as a header. and then i log it in nginx. this works fine when the
request finishes correctly, but when something crashes
in the upstream-server, and no response reaches nginx, there is no
uuid, so no uuid is written to the nginx logs. so, when
i start to investigate why things went wrong, i find the uuid in the
upstream-server logs, but i cannot match it to a line
in the nginx access logs.

any ideas?

the only thing i could find is to use something like
https://github.com/simpl/ngx_http_set_hash,
and generate a hash from ip_address+timestamp+whatever, and send it to
upstream and log it,
but this means i have to recompile nginx, and still i'm not sure if it
will work or not :)

thanks,
gabor

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

unique_id

Gábor Farkas July 18, 2011 05:08AM

Re: unique_id

Jonathan Matthews June 28, 2012 05:56PM

Re: unique_id

Igor Sysoev June 29, 2012 02:00AM

Re: unique_id

Jonathan Matthews June 29, 2012 09:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready