Answer the question
In order to leave comments, you need to log in
How to properly configure proxying of one nginx to another, so that ip is processed correctly?
There are two different servers with nginx.
The first accepts requests and forwards them to the second, which, in turn, parks them on a local socket, which is not very important now.
The problem is that the second nginx is not accepting the correct ip. If you believe the logs, it always turns out to be equal to the ip-address of the server itself, and not the client that made the request.
The receiving proxy has a default setting:
location / {
proxy_pass http://IP:PORT;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question