location 匹配:
/Test1
/Test1/
/Test1/Test2
/Test1/Test2/
/test1/Test2/
https://192.168.137.2:2443/Test1/
location ~ /Test1/$ {
return 200 'first regular match';
}
前缀字符串 /aa
= 精确匹配
^~ 匹配后则不再进行正则表达式匹配
~ 正则表达式
location ~ /Test1/$ {
return 200 'first regular match';
}
location = /Test1/ {
return 200 'second regular match';
}
此时会匹配第2个 :
second regular matchnode2:/root#curl https://192.168.137.2:2443/Test1/
second regular matchnode2:/root#