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.

3
  • Try using a map. Commented Jun 3, 2021 at 9:51
  • @GerardH.Pille why? What is the difference? Commented Jun 3, 2021 at 10:02
  • One of the differences is that maps work. Commented Jun 3, 2021 at 11:39

1 Answer 1

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; } } 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.