根据请求 cookie 设置不同的变量
map $http_cookie $rootpath {
"~gray" "/data/gray";
default "/data";
}
server {
listen 80;
server_name devtest.foobar.cn;
access_log logs/devtest_access.log main;
index index.html index.htm index.jsp index.do;
root /data;
location ~ /omg {
root $rootpath;
try_files $uri $uri/;
}
1
sanmaozhao 2019-12-12 11:32:22 +08:00
set_by_lua 应该可以?
https://github.com/openresty/lua-nginx-module#set_by_lua |