Modifying or adding cookies via nginx.conf

Manlio Perillo manlio_perillo at libero.it
Thu Mar 6 14:56:31 MSK 2008


Laurent Thevenet ha scritto:
> On Wed, Mar 5, 2008 at 2:19 AM, Manlio Perillo <manlio_perillo at libero.it> 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 Perillo





More information about the nginx mailing list