nginx cookie value acquisition request header

server added

1. Get JSESSIONID

set $JSESSIONID_TOKEN "";
if ($http_cookie ~* "JSESSIONID=([\w-]+?)(?=;|$)") {
      set $JSESSIONID_TOKEN "$1";
}

 

2. Get the cookie value KEY value other name

set $MUSIC_CHN_CK "";
if ($http_cookie ~* "MUSIC_CHN=(.+?)(?=;|$)") {
      set $MUSIC_CHN_CK "$1";
}

Guess you like

Origin www.cnblogs.com/shanyingyuyan/p/11309991.html