首页 > 解决方案 > 在 azure 容器中的 docker 中获取客户端 IP

问题描述

有没有人可以帮助我从运行在 Azure 容器实例上的 docker 容器获取用户客户端 IP?

我的代码只获取某些东西的本地 IP,我猜它是反向代理。所以ip是10.240.255.106;是标头我也有主机 IP(公共容器 IP),但仅此而已。标头

{"Cache-Control":["max-age=0"],"Connection":["keep-alive"],"Accept":["text/html,application/xhtml+xml,application/xml;q =0.9,image/webp,image/apng, / ;q=0.8"],"Accept-Encoding":["gzip, deflate"],"Accept-Language":["en-US,en;q=0.9 ,ru-RU;q=0.8,ru;q=0.7"],"Host":["23.99.249.54"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit /537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"],"Upgrade-Insecure-Requests":["1"],"DNT":["1"]}

有没有办法获得真正的客户端IP?

标签: azureazure-container-instances

解决方案


不,ACI 不保留客户端 IP。您可以在用户语音中创建功能请求。 https://feedback.azure.com/forums/602224-azure-container-instances?filter=top&page=1


推荐阅读