UID problem with nginx

Harish Sundararaj tuxtoti at gmail.com
Mon Nov 3 15:24:14 MSK 2008

Hi all,
I have two issues with cookie logging:

1) I want to know which is the best way to say this in nginx:

If the user is new user log $uid_set else log $uid_got instead.

I was previously having apache on my servers..and this was happening by
default. But I don't know what to do now..in nginx. Basically i want the
cookie to be logged whether he is
a new user or not. But I dont want to log both $uid_set an $uid_got on my

I can only think of one way to achieve this...an if block that checks
$uid_got to have any value...if it has,  have a log format (say A)
another if block again checking the same thing and it has no value then have
a different log format(say B).

Is there a better way?

2) I understand that the nginx sends the base64 encoded value of the cookie
to the browser..but logs($uid_set/$uid_got) the actual value as a hex
For Eg:
like on the browser we have:


But on the logs when we log $uid_got we get :


I know both are same.

But the issue is I have one another apache server (a subdomain) which just
logs.. cookies (HTTP_COOKIE) (but no setting)  ..hence effectively this one
logs the value got from the browser (the base64 encoded value)..
Because of this I'm not able to do any correlational studies between logs of
nginx(which set the cookies) and the apache logs....Is there a way around?
other than me writing a wrapper to do an
in place edit of the logs?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20081103/f549c45c/attachment.html>

More information about the nginx mailing list