What is the difference between `X-Real-IP` and `X-Forwarded-For` headers?

Responsive Ad Header

Question

Grade: Education Subject: Support
What is the difference between `X-Real-IP` and `X-Forwarded-For` headers?
Asked by:
73 Viewed 73 Answers
Responsive Ad After Question

Answer (73)

Best Answer
(268)
`X-Real-IP` typically contains the original client IP address. `X-Forwarded-For` is a comma-separated list of IP addresses, including the client's IP and any proxies the request passed through. `X-Real-IP` is generally preferred for getting the originating client IP.