Reputation: 439
I am running a flask site on an Azure Linux Web App. I've come to a point where I need to know the client ip address. 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 server.
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?
Upvotes: 0
Views: 640
Reputation: 31384
In Azure Linux Web App, it will change the request from the Internet through the reverse proxy. So you need to use the request
package to get the client. The example code here:
clinet_ips = request.headers.getlist("X-Forwarded-For")
Upvotes: 2