UID problem with nginx

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

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
a different log format(say B).

Is there a better way?

  1. I understand that the nginx sends the base64 encoded value of the
    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
logs… cookies (HTTP_COOKIE) (but no setting) …hence effectively this
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
other than me writing a wrapper to do an
in place edit of the logs?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs