Answer the question
In order to leave comments, you need to log in
How to parse header in nginx?
Good day.
I hope you can tell me which way to dig.
There is a bunch of nginx + apache, which in turn is hidden behind another server that is responsible for balancing.
Nginx on the server works as a proxy, but the HTTP_X_FORWARDED_FOR header contains a chain of ip addresses (balancer and user),
i.e. header HTTP_X_FORWARDED_FOR=192.168.0.1, 192.168.10.1
where 192.168.0.1 is the user's real ip, 192.168.10.1 is the ip of the balancer
, the question is, is it possible to somehow parse the HTTP_X_FORWARDED_FOR header and put the first address in the header: REMOTE_ADDR?
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