非常鬱悶,造訪首頁的請求,可以從cookie裡把uid分析出來,但其他的請求全不行。
直接列印Cookie出來,首頁和其他請求,沒有區別
我的Nginx設定檔
set $uid "-"; if ( $http_cookie ~* "uid=(\S+)(;.*|$)"){ set $uid ; } log_format s_access '[$time_local] $remote_addr - "$request" - ' '$status - $body_bytes_sent - "$http_referer" - ' '"$http_user_agent" - $request_time - "$uid" "$http_cookie"';
兩個Access Log,上邊一個是訪問/list cookie 在最後一個""內,前一個""是空的,看樣子是if進來了,但是uid是空的;下筆那一個是訪問/ cookie和前一個一樣,在""內,前一個""有值,識別出來了。
非常鬱悶!
[04/Dec/2012:21:44:43 +0800] 145.122.142.124 - "GET /list HTTP/1.1" - 200 - 18573 - "-" - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.60 Safari/537.11" - 0.079 - "" "__c_uactiveat=1350108823468; __c_review=46; __c_last=1351061042906; __c_visitor=1350104003730701; uid=103; __utma=224849432.425128387.1339588739.1354606821.1354625898.809; __utmb=224849432.12.10.1354625898; __utmc=224849432; __utmz=224849432.1354108162.783.24.utmcsr=e.weibo.com|utmccn=(referral)|utmcmd=referral|utmcct=/2036070420/z7ixpvGv4; sess=50b8f.796" [04/Dec/2012:21:45:18 +0800] 145.122.142.124 - "GET / HTTP/1.1" - 200 - 13449 - "-" - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.60 Safari/537.11" - 0.248 - "1030000000091320" "__c_uactiveat=1350108823468; __c_review=46; __c_last=1351061042906; __c_visitor=1350104003730701; uid=103; __utma=224849432.425128387.1339588739.1354606821.1354625898.809; __utmb=224849432.13.10.1354625898; __utmc=224849432; __utmz=224849432.1354108162.783.24.utmcsr=e.weibo.com|utmccn=(referral)|utmcmd=referral|utmcct=/2036070420/z7ixpvGv4; sess=50b8f.796"