variable on userid_domain

Daniele Melosi ml at
Fri Dec 12 19:38:04 MSK 2008

Hi all,

I'm trying to pass a variable $domain on userid_domain switch but it 
doesn't work:

this is the result:
daniele at lara:~$ HEAD http://localhost
200 OK
Connection: close
Date: Fri, 12 Dec 2008 16:31:59 GMT
Accept-Ranges: bytes
Server: nginx/0.6.32
Content-Length: 151
Content-Type: text/html
Last-Modified: Wed, 30 Aug 2006 10:39:17 GMT
Client-Date: Fri, 12 Dec 2008 16:31:59 GMT
Client-Response-Num: 1
P3P: policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID"
Set-Cookie: test_cookie=AQAAf0lCkf93nyG2AwMEAg==; expires=Sat, 12-Dec-09 
16:31:59 GMT; domain=$domain; path=/

as you can see domain is $domain

Here my "simplyfied configuration":

server {
        listen   80;
        server_name  localhost host1;

        set $domain "mydomain2";
        if ( $host ~ "host1" ) {
                set $domain "mydomain";

        userid          on;
        userid_name     test_cookie;
        userid_domain   $domain;
        userid_path     /;
        userid_expires  365d;
        userid_p3p      'policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR 

how can i solve this (i'd like to avoid to create 2 different server 
definition) ?


More information about the nginx mailing list