Capturing Encoded Location Variable Data

Demitrious Kelly demitrious at automattic.com
Wed Apr 7 22:07:34 UTC 2021


Hello,

Given the following two location configurations:

location ~ ^/test/named/(?<foo>.+)$ {
  return 200 $foo;
}

location ~ ^/test/numbered/(.+)$ {
  set $foo $1;
  return 200 $foo;
}
Are the following two results expected?

# curl http://127.0.0.1:8088/test/named/%D7%94%D7%98%D7%99%D7%95%D7%9C
הטיול

# curl http://127.0.0.1:8088/test/numbered/%D7%94%D7%98%D7%99%D7%95%D7%9C
%D7%94%D7%98%D7%99%D7%95%D7%9C

I have not been able do find any documentation, yet, explaining why these two methods of capturing the same data yield different results.

Thanks in advance!
DK



More information about the nginx mailing list