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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to