How get user IP when using a 'Proxy' #5027
Answered
by
RonnyPfannschmidt
BobSquarePants
asked this question in
Q&A
-
HI everyone, I'm using nginx -> Gunicorn -> Flask Great, but when I'm doing a request.environ['REMOTE_ADDR'] I get the localhost (127.0.0.1) So I suppose I have to setup nginx and Gunicorn (also ?) to forward the header ? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
RonnyPfannschmidt
Mar 13, 2023
Replies: 1 comment 4 replies
-
by applying https://werkzeug.palletsprojects.com/en/2.2.x/middleware/proxy_fix/ this is intentionally not the default to protect apps from being passed those headers with malicious intent |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
BobSquarePants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
by applying https://werkzeug.palletsprojects.com/en/2.2.x/middleware/proxy_fix/
this is intentionally not the default to protect apps from being passed those headers with malicious intent