# 最后显示的 IP 是反向代理 IP 地址

**URL:** https://meta.discourse.org/t/last-ip-shows-reverse-proxy-ip-address/113032
**Category:** Support
**Created:** [2019年三月31日 00:25 UTC](https://meta.discourse.org/t/last-ip-shows-reverse-proxy-ip-address/113032 "2019-03-31T00:25:10Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [2019年五月22日 22:25 UTC](https://meta.discourse.org/t/last-ip-shows-reverse-proxy-ip-address/113032/6 "2019-05-22T22:25:41Z")

</div>

> [@PhoenixPeca](#):
>
> I have included these revers proxy settings properly… But why does it still show my Reverse Proxy server’s IP Address (hostname to be specific)

Probably you need to remove the same definitions from docker, modify your _app.yml_ and rebuild:

```plaintext
run:
  - exec: echo "Beginning of custom commands"

  - replace:
       filename: /etc/nginx/conf.d/discourse.conf
       from: $proxy_add_x_forwarded_for
       to: $http_fastly_client_ip
       global: true

  - exec:
       cmd:
         - sed -i 's/client_max_body_size 10m ;/client_max_body_size 100m ;/g' /etc/nginx/conf.d/discourse.conf
         - sed -i '/proxy_set_header X-Real-IP $remote_addr;/d' /etc/nginx/conf.d/discourse.conf
         - sed -i '/proxy_set_header X-Forwarded-For $http_fastly_client_ip;/d' /etc/nginx/conf.d/discourse.conf
         - sed -i '/proxy_set_header X-Forwarded-Proto $scheme;/d' /etc/nginx/conf.d/discourse.conf

  - exec: echo "End of custom commands"

```

This block has 100m limit for _max\_body\_size_ as well (the first sed command makes a replacement). The other sed commands remove lines from _discourse.conf_ inside docker before container starts.

---

_[View the full topic](https://meta.discourse.org/t/last-ip-shows-reverse-proxy-ip-address/113032)._
