# IP Lookup is Pulling CDN's X-Forwarded-For

**URL:** <https://meta.discourse.org/t/ip-lookup-is-pulling-cdns-x-forwarded-for/202918>\
**Category:** Self-hosting\
**Created:** [September 8, 2021, 1:13am UTC](https://meta.discourse.org/t/ip-lookup-is-pulling-cdns-x-forwarded-for/202918 "2021-09-08T01:13:42Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![hyphalos](https://avatars.discourse-cdn.com/v4/letter/h/3ab097/32.png) [@hyphalos](https://meta.discourse.org/u/hyphalos)\
**Post date:** [September 8, 2021, 1:13am UTC](https://meta.discourse.org/t/ip-lookup-is-pulling-cdns-x-forwarded-for/202918/1 "2021-09-08T01:13:42Z")

</div>

Hi Discourse community!

Am I correct to assume that IP Lookup gets the last IP from the X-Forwarded-For header? Cloudfront seems to be attaching their IP at the end.

How would we modify nginx to remove the last IP in the X-Forwarded-For header? We were hoping to get the client IP to prevent spammers.

Could anyone please provide help / guidance?

Cheers

---

_[View the full topic](https://meta.discourse.org/t/ip-lookup-is-pulling-cdns-x-forwarded-for/202918)._
