# Last IP address and action\_dispatch.trusted\_proxies

**URL:** https://meta.discourse.org/t/last-ip-address-and-action-dispatch-trusted-proxies/50098
**Category:** Support
**Created:** [13 Septiembre, 2016 17:50 UTC](https://meta.discourse.org/t/last-ip-address-and-action-dispatch-trusted-proxies/50098 "2016-09-13T17:50:59Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [13 Septiembre, 2016 23:43 UTC](https://meta.discourse.org/t/last-ip-address-and-action-dispatch-trusted-proxies/50098/3 "2016-09-13T23:43:57Z")

</div>

We don’t use trusted\_proxies in our hosted environment; we adjust the nginx config to set `X-Real-IP` directly, since, IIRC, the `RemoteIp` middleware prefers that over XFF. The pups exec stanza we use looks like this:

```
- replace:
    filename: /etc/nginx/conf.d/discourse.conf
    from: "types {"
    to: |
      set_real_ip_from 10.0.0.0/24;
      set_real_ip_from 172.17.0.0/24;
      real_ip_header X-Forwarded-For;
      real_ip_recursive on;
      types {

```

---

_[View the full topic](https://meta.discourse.org/t/last-ip-address-and-action-dispatch-trusted-proxies/50098)._
