我有如下所示的url查询参数,并想将所有特殊字符替换为nginx config中的原始字符,请您提供一种解决方法?
targeturl = https%3A%2F%2Fexample.com:443%2Fapi%2Fv1%2Fcluster%2Fstatus
targeturl = https://example:443/api/v1/cluster/status
尝试以下操作,但不起作用:
server {
server_name localhost;
listen 127.0.0.1:8001 default_server;
listen [::1]:8001 default_server;
location / {
if ($args ~* (.*)[%2f](.*)$) {
set $args $1/$2;
}
proxy_pass $args;
}
}
谢谢。