Answer the question
In order to leave comments, you need to log in
Remote_addr and user ip?
There is a bunch of nginx gunicorn django.
The user's ip is written to the database when the user leaves a request, it is used simply as additional information about the user.
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-Protocol $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Answer the question
In order to leave comments, you need to log in
proxy_add_x_forwarded_for is a dangerous header, because in fact, any proxy can modify it in any way.
a simple example, I set myself a local proxy and configure it so that the Pentagon's IP is written in this header. You will keep the information about what came to you from the Pentagon :)
If you use it, then you need to use it only for trusted IP addresses.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question