You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "jinjianming (via GitHub)" <gi...@apache.org> on 2023/03/31 02:33:10 UTC
[GitHub] [apisix] jinjianming opened a new issue, #9211: help request: Obtain the real IP address of the client
jinjianming opened a new issue, #9211:
URL: https://github.com/apache/apisix/issues/9211
### Description
The apisix proxy service is running, and I want to get the original real access IP, which is internally SNATed by k8s. How can I solve it? Check the log to see that the apisix IP has been converted.
```
real_ip_header: "X-Real-IP" # http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header
real_ip_from: # http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from
- 127.0.0.1
- 0.0.0.0/0
- 'unix:'
```
apisix log,10.233.65.0 It's my k8s ip
```
10.233.65.0 - - [31/Mar/2023:10:28:54 +0800] cjyoumen.com "GET / HTTP/1.1" 200 291051 0.005 "-" "Go-http-client/1.1" 10.233.64.57:80 200 0.005 "http://cjyoumen.com"
```
### Environment
- APISIX version (run `apisix version`): 3.2
- 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] help request: Obtain the real IP address of the client [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #9211: help request: Obtain the real IP address of the client
URL: https://github.com/apache/apisix/issues/9211
--
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] help request: Obtain the real IP address of the client [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9211:
URL: https://github.com/apache/apisix/issues/9211#issuecomment-2011807037
This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
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] jinjianming commented on issue #9211: help request: Obtain the real IP address of the client
Posted by "jinjianming (via GitHub)" <gi...@apache.org>.
jinjianming commented on issue #9211:
URL: https://github.com/apache/apisix/issues/9211#issuecomment-1491210885
Use this configuration to solve the problem of obtaining client IP addresses in ingress-nginx
```
compute-full-forwarded-for: "true"
```
--
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] jinjianming commented on issue #9211: help request: Obtain the real IP address of the client
Posted by "jinjianming (via GitHub)" <gi...@apache.org>.
jinjianming commented on issue #9211:
URL: https://github.com/apache/apisix/issues/9211#issuecomment-1491358005
This is because there is no corresponding Pod on our master node, so when accessing applications through the master node, additional network hops are necessary to reach the Pod on other nodes. During the hops, due to the SNAT performed on the data packets, the IP address of the master node is seen. At this time, we can set the ExternalTrafficPolicy in the Service to reduce network hops:
```
spec:
externalTrafficPolicy: Local
```
--
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] help request: Obtain the real IP address of the client [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9211:
URL: https://github.com/apache/apisix/issues/9211#issuecomment-2039398820
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.
--
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