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 2022/08/02 10:52:30 UTC

[GitHub] [apisix] mcy567 opened a new issue, #7596: https://apisix.apache.org/zh/docs/apisix/terminology/consumer/

mcy567 opened a new issue, #7596:
URL: https://github.com/apache/apisix/issues/7596

   ### Current State
   
   The configurations like Plugins and Upstream bound to the Consumer are then executed.  
   But I found that the upstream configured on the consumer did not take effect。
   
   [root@cluster1-172-21-48-10 example]# curl http://172.21.48.10:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "mcy",
       "plugins": {
           "key-auth": {
               "key": "auth123"
           },            
           "limit-count": {
               "count": 5,
               "time_window": 60,
               "rejected_code": 403,
               "key": "remote_addr"
           }
       },
       "upstream": {
         "type": "roundrobin",
         "nodes": {
           "172.21.48.10:9082": 1,
           "172.21.48.10:9081": 1
         }
       }
   }'
   {"action":"set","node":{"value":{"plugins":{"key-auth":{"key":"auth123"},"limit-count":{"time_window":60,"show_limit_quota_header":true,"key_type":"var","rejected_code":403,"policy":"local","allow_degradation":false,"count":5,"key":"remote_addr"}},"upstream":{"type":"roundrobin","nodes":{"172.21.48.10:9082":1,"172.21.48.10:9081":1}},"username":"mcy","create_time":1659435397,"update_time":1659437288},"key":"\/apisix\/consumers\/mcy"}}
   
   [root@cluster1-172-21-48-10 example]# curl http://172.21.48.10:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/index.html",
       "id": 1,
       "plugins": {
           "key-auth": {}
       }                   
   }'
   {"action":"set","node":{"value":{"id":"1","priority":0,"update_time":1659437301,"create_time":1659435484,"status":1,"plugins":{"key-auth":{"query":"apikey","hide_credentials":false,"header":"apikey"}},"uri":"\/index.html","methods":["GET"]},"key":"\/apisix\/routes\/1"}}
   
   [root@cluster1-172-21-48-10 example]# curl http://172.21.48.10:9080/index.html -i -H "apikey: auth123" 
   HTTP/1.1 503 Service Temporarily Unavailable
   Date: Tue, 02 Aug 2022 10:48:36 GMT
   Content-Type: text/html; charset=utf-8
   Content-Length: 194
   Connection: keep-alive
   X-RateLimit-Limit: 5
   X-RateLimit-Remaining: 4
   Server: APISIX/2.15.0
   
   <html>
   <head><title>503 Service Temporarily Unavailable</title></head>
   <body>
   <center><h1>503 Service Temporarily Unavailable</h1></center>
   <hr><center>openresty</center>
   </body>
   </html>
   
   ### Desired State
   
   return 200


-- 
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.apache.org

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


[GitHub] [apisix] tzssangglass commented on issue #7596: help request: the upstream configured on the consumer did not take effect

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

   Upstream should not be configured in the consumer, it should be configured in the route or service, or configured it separately and refer to it with `upstream_id`. Anyway, you need to read the documentation first.
   
   ref: https://github.com/apache/apisix/blob/master/docs/en/latest/admin-api.md#consumer
   
   Close this, it is not a problem.


-- 
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 #7596: help request: the upstream configured on the consumer did not take effect

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

   > Thank for you reply.But I still have a question. “The configurations like Plugins and Upstream bound to the Consumer are then executed.” this sentence from [apisix.apache.org/docs/apisix/terminology/consumer](https://apisix.apache.org/docs/apisix/terminology/consumer/). Because my native language is not English, so this sentence means Consumer is made up of Plugins and Upstream or Consumer is the same as Plugins and Upstream?
   
   It does look like there will be some ambiguity. cc @juzhiyuan Maybe we can perfect 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


[GitHub] [apisix] mcy567 closed issue #7596: help request: the upstream configured on the consumer did not take effect

Posted by GitBox <gi...@apache.org>.
mcy567 closed issue #7596: help request: the upstream configured on the consumer did not take effect
URL: https://github.com/apache/apisix/issues/7596


-- 
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] mcy567 commented on issue #7596: help request: the upstream configured on the consumer did not take effect

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

   Thank for you reply.But I still have a question. “The configurations like Plugins and Upstream bound to the Consumer are then executed.” this sentence from https://apisix.apache.org/docs/apisix/terminology/consumer/. Because my native language is not English, so this sentence means   Consumer is made up of Plugins and Upstream   or   Consumer is the same as Plugins and Upstream?


-- 
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 closed issue #7596: help request: the upstream configured on the consumer did not take effect

Posted by GitBox <gi...@apache.org>.
tzssangglass closed issue #7596: help request: the upstream configured on the consumer did not take effect
URL: https://github.com/apache/apisix/issues/7596


-- 
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 #7596: help request: the upstream configured on the consumer did not take effect

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

   I noticed one detail.
   ```
   curl http://172.21.48.10:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/index.html",
       "id": 1,
       "plugins": {
           "key-auth": {}
       }                   
   }'
   ```
   
   It should fail, but it has worked, I have verified it.
   
   Just like this configuration below:
   
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
     "uri":"/index/*"
   }'
   ```
   
   It will fail because no upstream or service is configured.


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