这是我的服务器块。
server {
set $auth_header 'Bearer my_token';
listen 80;
server_name my.domain.com;
location ~ "(/d\-solo/[a-zA-Z]{8,10}/.+\?.+)" {
proxy_pass http://localhost:3000/$1;
proxy_set_header Authorization $auth_header;
}
location ~ "(/api/dashboards/uid/[a-zA-Z]{8,10})" {
proxy_pass http://localhost:3000/$1;
proxy_set_header Authorization $auth_header;
}
location ~ /(.*) {
proxy_pass http://localhost:3000;
#NO MATTER WHAT I DO, REQUESTS GO HERE
proxy_set_header Authorization $auth_header;
}
}
我无法使我的位置块与 URL 匹配。例如,下面的 URL 与最下面的块匹配,但我希望它与最上面的块匹配。
http://my.domain.com/d-solo/VYbRWmhZk/grafer?orgId=1&refresh=5m&from=1571353874733&to=1573949474733&var-Marketplace=&panelId=14