You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "1450793561 (via GitHub)" <gi...@apache.org> on 2025/05/12 14:57:28 UTC

[I] bug: How does the chash algorithm calculate based on the client's ip [apisix]

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

   ### Current Behavior
   
   apisix version 3.9.1 uses the chash algorithm. How to hash and calculate based on the real ip of the client? Now our requirement is that the domain name abc.5i5j.com is equipped with a cdn. If the key configured in chash uses remoter_addr, will we always get the ip of the cdn node
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   apisix verison 3.9.1
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.9.1
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `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.apache.org

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


Re: [I] request help: How does the chash algorithm calculate based on the client's ip [apisix]

Posted by "1450793561 (via GitHub)" <gi...@apache.org>.
1450793561 commented on issue #12204:
URL: https://github.com/apache/apisix/issues/12204#issuecomment-2875217557

   > If chash_key is not obtained (key is empty or does not exist), remote_addr is used as the hash key by default.
   > 
   > You can try to configure the real-ip plugin to get the real client IP from the HTTP header (usually X-Forwarded-For).
   
   
   The configuration file has been configured as follows. Is there any other configuration needed under this configuration?
   
   ```
   real_ip_recursive: "on"
   
   real_ip_header: X-Forwarded-For
   
   real_ip_from:            ngx_http_realip_module.html
   
   -10.20.128.0/24
   
   -10.15.66.0/24 
   ```
   
   


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


Re: [I] bug: How does the chash algorithm calculate based on the client's ip [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #12204:
URL: https://github.com/apache/apisix/issues/12204#issuecomment-2874838184

   If chash_key is not obtained (key is empty or does not exist), remote_addr is used as the hash key by default.
   
   You can try to configure the real-ip plugin to get the real client IP from the HTTP header (usually X-Forwarded-For).


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


Re: [I] request help: How does the chash algorithm calculate based on the client's ip [apisix]

Posted by "1450793561 (via GitHub)" <gi...@apache.org>.
1450793561 commented on issue #12204:
URL: https://github.com/apache/apisix/issues/12204#issuecomment-2875246607

   How to use apisix's chash to configure session persistence to be the same as nginx's stricy


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


Re: [I] request help: How does the chash algorithm calculate based on the client's ip [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #12204: request help: How does the chash algorithm calculate based on the client's ip
URL: https://github.com/apache/apisix/issues/12204


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


Re: [I] request help: How does the chash algorithm calculate based on the client's ip [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #12204:
URL: https://github.com/apache/apisix/issues/12204#issuecomment-2875669062

   > > If chash_key is not obtained (key is empty or does not exist), remote_addr is used as the hash key by default.
   > > You can try to configure the real-ip plugin to get the real client IP from the HTTP header (usually X-Forwarded-For).
   > 
   > The configuration file has been configured as follows. Is there any other configuration needed under this configuration?
   > 
   > ```
   > real_ip_recursive: "on"
   > 
   > real_ip_header: X-Forwarded-For
   > 
   > real_ip_from:            ngx_http_realip_module.html
   > 
   > -10.20.128.0/24
   > 
   > -10.15.66.0/24 
   > ```
   
   Will this work properly?


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


Re: [I] request help: How does the chash algorithm calculate based on the client's ip [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #12204:
URL: https://github.com/apache/apisix/issues/12204#issuecomment-2889872142

   If there is still a problem, please open it again.


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