Hi,
I’m dealing with the issue of modifying or adding a cookie on the fly
via nginx.conf
I look through all the doc and did not find anything except about
identification (http://wiki.codemongers.com/NginxHttpUserIdModule) and
from an external module i forgot about the name (allowing to access
cookies individually but not to set them for the moment).
So, as i want a cookie value to depend on the URL, i’m looking at all
the options and i just want to know if it’s possible and where to look
for in that case.
Thx guys.
Laurent Thevenet ha scritto:
Hi,
I’m dealing with the issue of modifying or adding a cookie on the fly
via nginx.conf
I look through all the doc and did not find anything except about
identification (http://wiki.codemongers.com/NginxHttpUserIdModule) and
from an external module i forgot about the name (allowing to access
cookies individually but not to set them for the moment).
Do you mean this:
http://hg.mperillo.ath.cx/nginx/mod_parsed_vars/
?
It’s a module I have written some time ago.
So, as i want a cookie value to depend on the URL, i’m looking at all
the options and i just want to know if it’s possible and where to look
for in that case.
Thx guys.
What do you want to do, in detail?
Regards Manlio P.
On Wed, Mar 5, 2008 at 2:19 AM, Manlio P.
[email protected] wrote:
Thx guys.
What do you want to do, in detail?
I wanted to set up a language cookie depending on the url as googlebot
is indexing all our content in english when the website is available
both in french and in english. It’s more a conception issue and i
wanted a temporary but immediate solution, as nginx is in front of a
mongrel cluster in fact and setting up a cookie was one of them.
And yes it was your mod (parsed vars) that i saw 
Laurent Thevenet ha scritto:
On Wed, Mar 5, 2008 at 2:19 AM, Manlio P. [email protected] wrote:
[…]
What do you want to do, in detail?
I wanted to set up a language cookie depending on the url as googlebot
is indexing all our content in english when the website is available
both in french and in english.
How is the language selected?
It’s strange if a cookie will solve the problem.
It’s more a conception issue and i
wanted a temporary but immediate solution, as nginx is in front of a
mongrel cluster in fact and setting up a cookie was one of them.
And yes it was your mod (parsed vars) that i saw 
You can try with:
add_header Cookie “lang=$request_url”
If you need more control, then you have to write a custom extension.
Manlio P.
On Thu, Mar 6, 2008 at 7:56 PM, Manlio P.
[email protected] wrote:
both in french and in english.
How is the language selected?
It’s strange if a cookie will solve the problem.
Initial language selection (as it can be change manually after) is
made based on your IP but i’m not in charge of that so i cannot tell
you exactly how it’s working. I simply know a cookie is holding the
language selection after that, i just wanted to force it or to give
the web developer an indication about the language depending on the
url (if subdomain is fr.fonzz.com for example).
The issue was concerning the search engine bots that would have
consider our pages to be duplicated as bots are not handling cookies
and google bot is for example always considered speaking english.
But we have dealt with the issue differently by doing all these things
in the web code so i’m not in charge of that anymore but adding
headers in nginx.conf was just one of the solution
add_header Cookie “lang=$request_url”
We hae done that, it was working fine but we change our plans finally
as it was only an immeida