Redirecting based on cookie value

mschipperheyn nginx-forum at
Fri Feb 3 19:16:28 UTC 2012


I'm want to redirect the user based on the value of a cookie, if

The scenario is one where there is a "starter" homepage for first time
users. As soon as users login, I write a cookie with the relative path
of another homepage. If the cookie is present, I want to redirect the
user to the cookie value: the relative path. There are multiple cookies
present in the request, such as session cookies.

I could of course, let the homepage be determined on the session on the
app server side, but since this is the landing page, I prefer to support
it with nginx reverse proxy caching. Hence the idea of using cookies to
redirect the user once he has logged in once.

Any ideas?


Posted at Nginx Forum:,221965,221965#msg-221965

More information about the nginx mailing list