# How can I modify the Nginx configuration directly within discourse/docker?

**URL:** https://meta.discourse.org/t/how-can-i-modify-the-nginx-configuration-directly-within-discourse-docker/406863
**Category:** Self-hosting
**Tags:** nginx
**Created:** [5 juli 2026 om 08:51 UTC](https://meta.discourse.org/t/how-can-i-modify-the-nginx-configuration-directly-within-discourse-docker/406863 "2026-07-05T08:51:52Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Boubou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/boubou/32/569633_2.png) [@Boubou](https://meta.discourse.org/u/Boubou)
#### Post date: [5 juli 2026 om 08:51 UTC](https://meta.discourse.org/t/how-can-i-modify-the-nginx-configuration-directly-within-discourse-docker/406863/1 "2026-07-05T08:51:52Z")

</div>

I would like to modify the Nginx/Docker configuration because my Discourse installation is behind HAProxy. The issue I am facing is as follows:  
All IPs connecting to my Discourse installation appear as the HAProxy IP address.  
I need to add the following lines to the Nginx configuration file:

`set_real_ip_from 127.0.0.1;`  
`real_ip_header proxy_protocol;`

…in order to pass the public IPs connecting to my Discourse installation through to Nginx.  
Thank you for your help.

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-modify-the-nginx-configuration-directly-within-discourse-docker/406863)._
