0

Trying to capture URLs like http://mydomain/1234567890123 (13 digits)

        location ~ ^/([\d]{13})$ {
            proxy_pass http://127.0.0.1:4000/product?id=$1;
    }

$1 variable arriving empty, even if URL is being captured. What am I missing?

P.S. Tried also named variables. Not helps.

Tamir
  • 101
  • 2

1 Answers1

0

An extract from a working configuration using a map:

map $uri $maptest {
    "~^(?<folder1>.*?)/?(\?.*)?$" page-cache$folder1/1.html;
}

server {
        location /node_direct/ {
          proxy_pass http://nodeServers/$maptest;
        }
}
Gerard H. Pille
  • 2,569
  • 1
  • 13
  • 11