fjs-icu commented on issue #6171:
URL: https://github.com/apache/apisix/issues/6171#issuecomment-1017579148


   
   
   ```
   oper1
   
    curl http://127.0.0.1:80/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
   "upstream": {
   "nodes": {
   "192.168.0.3:8081": 1
   },
   "type": "roundrobin"
   },
   "hosts": ["*.test1.com"],
   "uris": [ "/v1/*"],
   "priority": 1
   }'
   
   curl http://127.0.0.1:80/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
   "upstream": {
   "nodes": {
   "192.168.0.3:8082": 1
   },
   "type": "roundrobin"
   },
   "hosts": ["a.test1.com"],
   "uris": ["/*"],
   "priority": 10
   }'
   
   curl -I http://a.test1.com/v1/a  
   [20/Jan/2022:14:21:13 +0000] a.test1.com "HEAD /v1/a HTTP/1.1" 502 0 0.000 
"-" "curl/7.29.0" 192.168.0.3:8081 502 0.001 "http://a.test1.com";
   
   conclusion : no  matching router   a.test1.com  /*  192.168.0.3:8082
   
   ```
   oper2 
    ```
    curl http://127.0.0.1:80/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
   "upstream": {
   "nodes": {
   "192.168.0.3:8081": 1
   },
   "type": "roundrobin"
   },
   "hosts": ["*.test1.com"],
   "uris": [ "/v1/"],
   "priority": 10
   }'
   
   curl http://127.0.0.1:80/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
   "upstream": {
   "nodes": {
   "192.168.0.3:8082": 1
   },
   "type": "roundrobin"
   },
   "hosts": ["a.test1.com"],
   "uris": ["/*"],
   "priority": 1
   }'
   curl -I http://a.test1.com/v1/a
   [20/Jan/2022:14:18:36 +0000] a.test1.com "HEAD /v1/a HTTP/1.1" 502 0 0.000 
"-" "curl/7.29.0" 192.168.0.3:8082 502 0.001 "http://a.test1.com";
   
   
   conclusion : matching router   a.test1.com  /*  192.168.0.3:8082    ; but 
priority 1 < "priority": 10 
   
   doc is error ,A smaller value indicates a higher priority
   src : If different routes contain the same uri, determine which route is 
matched first based on the attribute priority. Larger value means higher 
priority
   
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to