I have a legacy backend wich doesn't interpret url-encoded %2B
as a +
sign in urls like
http://10.20.30.40/keyvalues?Name=foo%2Bbar%2Bbaz%2B...
http://10.20.30.40/keyvalues?Name=foo%2Bbaz
http://10.20.30.40/keyvalues?Name=foo
so I'm going to bring them to the form:
http://10.20.30.40/keyvalues?Name=foo+bar+baz+...
http://10.20.30.40/keyvalues?Name=foo+baz
http://10.20.30.40/keyvalues?Name=foo
with Nginx reverce-proxy. But I'm guess that in my case ngx_http_rewrite_module
's config wan't be so simple like in the docs, my current rule is:
location ~ keyvalues {
rewrite x2B +;
proxy_pass "$scheme://$http_host";
}
and it doesn't replaces (judging by the tcpdump
and backend's responces).
What is the correct way to replace multiple characters in the url? (just like with the sed's 's/%2B/+/g'
command.)