You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/16 04:06:08 UTC

[GitHub] [apisix] lishaoshu1240 opened a new issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

lishaoshu1240 opened a new issue #5526:
URL: https://github.com/apache/apisix/issues/5526


   ### Issue description
   
   request url:
   http://gw.stefan.com:9080/apisix/admin/routes/2
   
   body:
   {
     "methods": ["GET"],
     "host": "ab.stefan.com",
     "uri": "/*",
     "upstream": {
       "type": "roundrobin",
       "nodes": {
         "23.217.89.2:9082": 1,
         "23.217.89.2:9081": 1
       }
     }
   }
   
   when  request the url:  http://ab.stefan.com:9080/abc in postman.  I found it cant transe to my upstream nodes.
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5526:
URL: https://github.com/apache/apisix/issues/5526#issuecomment-969891897


   here is my conf:
   
   ```
   curl --location --request PUT 'http://127.0.0.1:9080/apisix/admin/routes/1' \
   --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "upstream": {
           "nodes": {
               "httpbin.org:80": 1
           },
           "type": "roundrobin"
       },
       "uri": "/*"
   }'
   ```
   
   and test
   
   ```
   curl 127.0.0.1:9080/get
   {
     "args": {},
     "headers": {
       "Accept": "*/*",
       "Host": "127.0.0.1",
       "User-Agent": "curl/7.64.1",
       "X-Amzn-Trace-Id": "Root=1-619348f5-51fea88e5ca45d560072fcc3",
       "X-Forwarded-Host": "127.0.0.1"
     },
     "origin": "127.0.0.1, 49.70.185.26",
     "url": "http://127.0.0.1/get"
   }
   ```
   
   it's ok.
   
   can you sure that this request is caught by `/routes/2`? `/*` means match any request uri.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] lishaoshu1240 edited a comment on issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
lishaoshu1240 edited a comment on issue #5526:
URL: https://github.com/apache/apisix/issues/5526#issuecomment-969912082


   curl  http://apisix.zaitugongda.com:9080/apisix/admin/routes
    {
       "action": "get",
       "count": 2,
       "node": {
           "key": "/apisix/routes",
           "nodes": [
               {
                   "modifiedIndex": 3652,
                   "createdIndex": 269,
                   "key": "/apisix/routes/2",
                   "value": {
                       "methods": [
                           "GET"
                       ],
                       "priority": 0,
                       "update_time": 1637043992,
                       "host": "web.zaitugongda.com",
                       "id": "2",
                       "uri": "/*",
                       "upstream": {
                           "scheme": "http",
                           "hash_on": "vars",
                           "pass_host": "pass",
                           "nodes": {
                               "web.zaitugongda.com:9081": 1
                           },
                           "type": "roundrobin"
                       },
                       "status": 1,
                       "create_time": 1636777744
                   }
               }
           ],
           "dir": true
       }
   }
   
   
   and test:
   
   stefan@mac iterm % curl http://web.zaitugongda.com:9080/get
   <html>
   <head><title>502 Bad Gateway</title></head>
   <body>
   <center><h1>502 Bad Gateway</h1></center>
   <hr><center>openresty</center>
   </body>
   </html>


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] lishaoshu1240 commented on issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
lishaoshu1240 commented on issue #5526:
URL: https://github.com/apache/apisix/issues/5526#issuecomment-969912082


   docker run --name api-gateway \
    -v /data/apisix/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \
    -v /data/apisix/apisix_log:/usr/local/apisix/logs  \
    -p 9080:9080 \
    -p 9091:9091  \
    -p 9443:9443 \
    --network apisix \
    --ip 172.18.5.11 \
    -d apache/apisix
   
   
    docker run --name api-gateway \
    -p 9080:9080 \
    -p 9091:9091  \
    -p 9443:9443 \
    --network apisix \
    --ip 172.18.5.11 \
    -d apache/apisix
   
    {
       "action": "get",
       "count": 2,
       "node": {
           "key": "/apisix/routes",
           "nodes": [
               {
                   "modifiedIndex": 3652,
                   "createdIndex": 269,
                   "key": "/apisix/routes/2",
                   "value": {
                       "methods": [
                           "GET"
                       ],
                       "priority": 0,
                       "update_time": 1637043992,
                       "host": "web.zaitugongda.com",
                       "id": "2",
                       "uri": "/*",
                       "upstream": {
                           "scheme": "http",
                           "hash_on": "vars",
                           "pass_host": "pass",
                           "nodes": {
                               "47.107.229.161:9081": 1
                           },
                           "type": "roundrobin"
                       },
                       "status": 1,
                       "create_time": 1636777744
                   }
               }
           ],
           "dir": true
       }
   }
   
   
   and test:
   
   stefan@mac iterm# curl http://47.107.229.161:9080/agc
   {"error_msg":"404 Route Not Found"}


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] lishaoshu1240 commented on issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
lishaoshu1240 commented on issue #5526:
URL: https://github.com/apache/apisix/issues/5526#issuecomment-969902527


   @tzssangglass ,can you sure that this request is caught by /routes/2? /* means match any request uri.
   
   yes


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] lishaoshu1240 closed issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
lishaoshu1240 closed issue #5526:
URL: https://github.com/apache/apisix/issues/5526


   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5526:
URL: https://github.com/apache/apisix/issues/5526#issuecomment-969960691


   502 means APISIX can not request the upstream, I think you should check the network problems 


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] lishaoshu1240 commented on issue #5526: "Route" transe function consult: can't transe "/*" to the upstream

Posted by GitBox <gi...@apache.org>.
lishaoshu1240 commented on issue #5526:
URL: https://github.com/apache/apisix/issues/5526#issuecomment-975413650


   > 502 means APISIX can not request the upstream, I think you should check the network problems
   
   thanks,its nework problems, i have reslove it. 


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org