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


   @tzssangglass   for oper1 and oper3 and oper4 : router priority  hight >  
host , 
   
   but  I want to http://a.test1.com/v1/a  match routes/2 ("hosts": 
["a.test1.com"] "192.168.0.3:8082")  ;That is  a.test1.com > *.test1.com ; 
a.test1.com  > *.test1.com , host > priority,  Do you know what I mean?
   
   oper3:
   ```
   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/*"]
   }'
   
   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": ["/*"]
   }'
   ```
   curl -I http://a.test1.com/v1/a
   apisix log:
   [20/Jan/2022:12:51:55 +0000] a.test1.com "HEAD /v1/a HTTP/1.1" 502 0 0.001 
"-" "curl/7.29.0" 192.168.0.3:8081 502 0.001 "http://a.test1.com";
   
   http://a.test1.com/v1/a  --> *.test1.com, 192.168.0.3:8081 
   
   
   =========================
   oper4 : 
   ```
        
   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/*"]
   }'
   
   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": ["/*"],
   "vars": [ 
        ["http_host", "==", "a.test1.com"]
   ]
   }'
   
   ```
   curl -I http://a.test1.com/v1/a
   apisixlog:   a.test1.com "HEAD /v1/a HTTP/1.1" 502 0 0.001 "-" "curl/7.29.0" 
192.168.0.3:8081 502 0.001 "http://a.test1.com";
   
    http://a.test1.com/v1/a  --> *.test1.com 192.168.0.3:8081 


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