Capturing Encoded Location Variable Data

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


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

# curl

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!

More information about the nginx mailing list