gpt4 book ai didi

redirect - Nginx 从变量或任何字符串中提取值

转载 作者:行者123 更新时间:2023-12-04 19:13:39 25 4
gpt4 key购买 nike

是否有使用 If 从 Nginx 配置文件中的变量中提取值的替代方法?

IE

    if ($http_referer ~* (?<=url=)([\w-.]*)(?=/) ){
set $proxied $1;
rewrite (?<=/)(.+\.(css|jpg|png|gif|js)) http://$proxied/$1 redirect;

}

谢谢

最佳答案

是的。 http://nginx.org/r/map

map $http_referer $proxied {
default example.com;
"~*(?<=url=)(?<p>[\w-.]*)(?=/)" $p;
}

关于redirect - Nginx 从变量或任何字符串中提取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12459518/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com