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/01/18 07:02:10 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #6140: feat:(plugins) make the ip-restriction plugin support mutil-level proxy agent

spacewander commented on a change in pull request #6140:
URL: https://github.com/apache/apisix/pull/6140#discussion_r786460632



##########
File path: apisix/plugins/ip-restriction/init.lua
##########
@@ -89,8 +89,13 @@ end
 
 function _M.restrict(conf, ctx)
     local block = false
-    local remote_addr = ctx.var.remote_addr
-
+    local remote_addr_arr = ctx.var.http_x_forwarded_for

Review comment:
       You can solve it with a global real_ip configuration:
   https://github.com/apache/apisix/blob/3773f2626e5753f95cc040c27b59fd0cff264513/conf/config-default.yaml#L226-L230
   
   Or a route-level solution, the `real-ip` plugin: https://apisix.apache.org/docs/apisix/plugins/real-ip




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