On Sat, Oct 24, 2009 at 04:46:07PM +0200, Fr Tr wrote:
(the original url that works is
}
…but it doesn’t like the ^~ which btw means the wiki for
NginxHttpRewriteModule is outdated for 0.6.29.
If never has “^~”. This combination used in location matching and
means “no regex”, i.e. do not search for regex locations if this
static location match.
Proably you mean “!~” instead, but this anyway won’t work as in
your case jsessionid isn’t in args but in path instead (three is
no ‘?’ which separates them).
My question is: how can I simply do a rewrite to replace “%3B” to “;” ?
The basic problem is that you want to match “%3B” while nginx
already decoded it to be “;” instead. So the only aproach that
will work is matching against $request_uri, the original URI as got
from client.
Try this:
if ($request_uri ~ "%3Bjsessionid=") {
rewrite ^(.*)$ http://example.com$1 permanent;
}
This will catch clients with “%3B” but not ones with “;”.
Resulting redirect will have “%3B” replaced by “;” as nginx
already decoded it in internal representation.