variable on userid_domain

Igor Sysoev is at rambler-co.ru
Sun Dec 14 18:08:47 MSK 2008


On Fri, Dec 12, 2008 at 05:38:04PM +0100, Daniele Melosi wrote:

> 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-Peer: 127.0.0.1:80
> 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 
> STA NID"';
>         [cut]
> 
> 
> how can i solve this (i'd like to avoid to create 2 different server 
> definition) ?

userid does not support variables.
As to cookie domain, it's by default host name.

Also, I do not recommend to create single server difinition for several
servers. Eventually servers will differ and you need to seperate them.
It's better to do it from the very start.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list