hmthoo commented on issue #8117:
URL: https://github.com/apache/apisix/issues/8117#issuecomment-1284869138

   > you can learn how to use redis in APISIX from:
   > 
   > 
https://github.com/apache/apisix/blob/23356d6c4a58379f5cf33be92e0d88cc6399a853/apisix/plugins/limit-count/limit-count-redis.lua#L54-L109
   > 
   > and how to set upstream from:
   > 
   > 
https://github.com/apache/apisix/blob/23356d6c4a58379f5cf33be92e0d88cc6399a853/apisix/plugins/example-plugin.lua#L84-L108
   
   > 
   
   thanks.   
   
   I'm having problems using this plugin in router.
   
   code
   ```
   ...
   
   function _M.rewrite(conf, ctx)
       core.log.warn("plugin rewrite phase, conf: ", core.json.encode(conf))
       core.log.warn("conf_type: ", ctx.conf_type)
       core.log.warn("conf_id: ", ctx.conf_id)
       core.log.warn("conf_version: ", ctx.conf_version)
   end
   
   function _M.access(conf, ctx)
       core.log.warn("plugin access phase, conf: ", core.json.encode(conf))
       if not conf.ip then
           core.log.warn("1111111111111")
           return
       end
       return
   end
   
   return _M
   ```
   
   error.log
   ```
   ... phase_func(): plugin rewrite phase, conf: {"disable":true}
   ... phase_func(): conf_type: route
   ... phase_func(): conf_id: 430412984771150526
   ... phase_func(): conf_version: 248
   ... phase_func(): plugin access phase, conf: {"disable":true}
   ... phase_func(): 1111111111111
   ```
   
   It seems impossible to get conf.ip
   
   I have created upstream "upstream-test1" and "upstream-test2" via the admin 
api. how do forward to it in the access phase?


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