"Member-v1.0=$cookie_Member-v1.0"
My logs come through as:
Member-v1.0=--v1.0
Is there a work around?
I've tried wrapping the name in curly brackets and also using
underscores but get an error about an unmatched bracket or no value.
I've tried the following formats:
"Member-v1.0=${cookie_Member-v1.0}"
"Member-v1.0=$cookie_Member_v1.0"
"Member-v1.0=$cookie_Member_v1_0"
Any help would be greatly appreciated. I don't want to have to move to
Apache :\
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223770,223770#msg-223770
_______________________________________________
nginx mailing list
ng...@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Currently, the names of nginx variables can be composed from
upper and lower English letters, digits and underscores. The
dash and dot characters are thus invalid.
Without patching the code, you should be able to log the entire
value of the "Cookie" request header field with the $http_cookie
variable. It can also be useful if you have cookies whose names
only differ in case as $cookie_<name> doesn't differentiate
between upper and lower case:
http {
server {
location / {
return 200 'http_cookie=$http_cookie cookie_a=$cookie_a cookie_A=$cookie_A\n';
}
}
}
$ curl -b 'a=a;A=A' http://localhost:8000/test
http_cookie=a=a;A=A cookie_a=a cookie_A=a
The map module may help:
map $http_cookie $member_cookie {
default NONE;
^Member-v1\.0=(?P<mc>[^;]+) $mc;
}
http://wiki.nginx.org/HttpMapModule
wbr, Valentin V. Bartenev
Oops.. must be:
map $http_cookie $member_cookie {
default '';
~Member-v1\.0=(?P<mc>[^;]+) $mc;
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223770,223790#msg-223790