Hi, I can confirm that using named variables solves the issue (as stated in the ticket - maybe you can add my findings (rewrite log) to the ticket comments, as I have no rights to do so). Both if ($request_uri ~ ^/[^\/]+(?<match>/.*)$ ) { set $patch $match; } and if ($request_uri ~ ^/[^\/]+(?<path>/.*)$ ) { set $match abc; } do work correctly. However, from the performanceby mte03 - Nginx Mailing List - English
Update: I have turned on rewrite log. The rewrite log shows uglyID correctly matched and sent to proxy unencoded. However in TCP dump, I can see that it was re-encoded again. Also on the target server, I can see the incoming request having uglyID re-encoded again.by mte03 - Nginx Mailing List - English
Hi, I have observed strange behavior with nginx rewrites. What happens: I get request going to myserver.com/appID/path1/path2/uglyID and I need to proxy this to appID.backend.internal/path1/path2/uglyID. The uglyID is URL encoded because it contains characters like commas and forward slashes. When I do location matching in nginx, nginx will url decode $uri parameter on which it does matches. Thby mte03 - Nginx Mailing List - English