[英]How can I get the user's IP-Address in my Cloud-Run Flask app?
[英]How can i get the client IP address in Flask running on an Azure Linux Web App?
我在 Azure Linux ZC6E190B2854633C48EZEZDA9 应用程序上运行 flask 站点。 我已经到了需要知道客户端 ip 地址的地步。 I have read many threads that talk about accessing the client IP address when behind a proxy and that you must update your nginx configuration file to pass this information through the proxy, however, I don't think my Azure Linux web app is running an nginx web 服务器。
How can I tell which web server my Azure Linux Web App is running and how can I start to look for the client IP address in the python code of my Flask app?
在Azure Linux Web App中,它会通过反向代理改变来自互联网的请求。 所以需要使用request
package来获取客户端。 这里的示例代码:
clinet_ips = request.headers.getlist("X-Forwarded-For")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.