map $http_cookie $member_cookie { default ""; ~^ip-djd=(?P<mc>[^;]+) $mc;}
Hello! 2016-01-04 18:42 GMT-08:00 Ke Gao: > 我想匹配cookie中ip-djd的值,并写入到新的变量里 > 如下: > > map $http_cookie $member_cookie { > default ""; > ~^ip-djd=(?P<mc>[^;]+) $mc; > } > > > 这样写对吗? > 另外,'?P' 是表示什么,当前匹配的值 存放到 mc变量吗? 建议转向使用 ngx_lua 模块,以避免编写这样难懂和易错的 nginx 配置。请见 https://github.com/openresty/lua-nginx-module#readme Regards, -agentzh
谢谢,就是说能用nginx_lua做到的事情就不要使用这种方法了,是吗?On Tuesday, January 5, 2016 at 10:45:50 AM UTC+8, agentzh wrote:Hello! 2016-01-04 18:42 GMT-08:00 Ke Gao: > 我想匹配cookie中ip-djd的值,并写入到新的变量里 > 如下: > > map $http_cookie $member_cookie { > default ""; > ~^ip-djd=(?P<mc>[^;]+) $mc; > } > > > 这样写对吗? > 另外,'?P' 是表示什么,当前匹配的值 存放到 mc变量吗? 建议转向使用 ngx_lua 模块,以避免编写这样难懂和易错的 nginx 配置。请见 https://github.com/openresty/lua-nginx-module#readme Regards, -agentzh --