# 커밋 b4a3389 업데이트 후 사용자 IP를 가져오는 방법

**URL:** https://meta.discourse.org/t/commit-b4a3389-ip/406267
**Category:** Self-hosting
**Tags:** nginx, cloudflare
**Created:** [6월 27, 2026, 3:02오전 UTC](https://meta.discourse.org/t/commit-b4a3389-ip/406267 "2026-06-27T03:02:07Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![CLOUD\_PHT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cloud_pht/32/568863_2.png) [@CLOUD\_PHT](https://meta.discourse.org/u/CLOUD_PHT)
#### Post date: [6월 27, 2026, 3:02오전 UTC](https://meta.discourse.org/t/commit-b4a3389-ip/406267/1 "2026-06-27T03:02:07Z")

</div>

업데이트 완료 후

> <https://github.com/discourse/discourse/commit/b4a3389751ebe118f58ec6dd5419d6007c61228f>
>
> nginx's responsibility is to determine the correct end user's IP (as far as we
> c…an trust it) and report that to Discourse.
> 
> The correct way to do that is to teach nginx how to determine this for itself -
> this means that both the nginx logs and the downstream value will be correct.
> 
> (see https://github.com/discourse/discourse\_docker/pull/1077 which removes the
> only use of \`proxy\_add\_x\_forwarded\_for\`)
> 
> Setting the x-f-f header to \`$proxy\_add\_x\_forwarded\_for\` or
> \`$http\_x\_forwarded\_for\` hides this learned knowledge and forces Discourse to go
> through the same process and possibly arrive at a edifferent answer.
> 
> In most cases this won't make a difference, but when there is more than one
> proxy in front of Discourse this exposes a failure case.
> 
> client → proxyA → proxyB → nginx → discourse
> 
> means Discourse saw:
> \`\`\`
> x-real-ip: client\_ip
> x-forwarded-for: client\_ip, proxyA
> \`\`\`
> 
> and might end using \`client\_ip\` or \`proxyA\_ip\` depending on codepath.
> 
> After this change, Discourse sees:
> \`\`\`
> x-real-ip: client\_ip
> x-forwarded-for: client\_ip
> \`\`\`
> 
> for the same situation.

모든 사용자의 마지막 사용 주소가 Docker 게이트웨이(예: 172.17.0.1)로 변경되었습니다.

제가 사용하는 아키텍처는 다음과 같습니다.

Cloudflare → VPS Nginx → Discourse Docker Nginx → Discourse

---

_[View the full topic](https://meta.discourse.org/t/commit-b4a3389-ip/406267)._
