tiangolo / uwsgi-nginx-flask-docker

Docker image with uWSGI and Nginx for Flask applications in Python running in a single container.
https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/
Apache License 2.0
2.99k stars 608 forks source link

How to obtain the real user IP address. #325

Closed WuKaiYi closed 2 months ago

WuKaiYi commented 1 year ago

client_ip = request.remote_addr

Using request.remote_addr to obtain the client's IP address always returns 172.21.0.1.

How can I obtain the real IP address?