Answer the question
In order to leave comments, you need to log in
Parse HTTP_X_FORWARDED_FOR content or not?
Good afternoon.
There is a domain, record And corresponds to ip1. On ip1 there is a proxy nginx that makes an entry like:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
Answer the question
In order to leave comments, you need to log in
X-Forwarded-For contains a chain of addresses that were passed by the client, each subsequent proxy in the chain (if configured so) adds the address from which the request was made. Accordingly, there can be no trust in these addresses, the client can enter anything there.
X-Real-IP is the IP address from which the request to nginx was made. Trust in it is possible if the backend cannot be requested bypassing your nginx (otherwise, anything can be passed there too).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question