# Discourse not support proxy\_protocol

**URL:** https://meta.discourse.org/t/discourse-not-support-proxy-protocol/211311
**Category:** Self-hosting
**Created:** [December 7, 2021, 2:43am UTC](https://meta.discourse.org/t/discourse-not-support-proxy-protocol/211311 "2021-12-07T02:43:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shihuang214](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shihuang214/32/242738_2.png) [@shihuang214](https://meta.discourse.org/u/shihuang214)
#### Post date: [December 7, 2021, 2:43am UTC](https://meta.discourse.org/t/discourse-not-support-proxy-protocol/211311/1 "2021-12-07T02:43:24Z")

</div>

If discourse after haproxy ,now we use proxy\_protocol,but now discourse not support it.  
nginx doc:

> **[Accepting the PROXY Protocol | NGINX Documentation](https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol)**
>
> Learn how to deliver, manage, and protect your applications using F5 NGINX products.

I try to fix this problem by using template,but

Since most of them are based on similar templates, it may not be a good solution

PR for it  
[https://github.com/discourse/discourse\_docker/pull/583](https://github.com/discourse/discourse_docker/pull/583)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [December 7, 2021, 8:06am UTC](https://meta.discourse.org/t/discourse-not-support-proxy-protocol/211311/2 "2021-12-07T08:06:53Z")

</div>

I think you should handle this in a similar way of how Cloudflare is being handled (after all, Cloudflare is an upstream proxy / load balancer as well). See [discourse\_docker/templates/cloudflare.template.yml at ae5a223074388795e4ea073a162cbf1dc174d392 · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/blob/ae5a223074388795e4ea073a162cbf1dc174d392/templates/cloudflare.template.yml)

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [August 24, 2022, 6:15am UTC](https://meta.discourse.org/t/discourse-not-support-proxy-protocol/211311/3 "2022-08-24T06:15:39Z")

</div>

Is there any change concerning support for the proxy protocol ?

In our setup we currently use haproxy for ssl termination and apache2 as outer rev-proxy which then connects to a unix websocket for the web\_only discourse container. I want so switch to nginx for the outer rev proxy and also implement the proxy protocol which is also supported by haproxy.

> **[Using HAProxy with the Proxy Protocol to Better Secure Your Database](https://www.haproxy.com/blog/using-haproxy-with-the-proxy-protocol-to-better-secure-your-database)**
>
> Why use the Proxy protocol? Well, when you lose client information like IP address when relaying connections through proxies, this tends to prevent you from...

It looks like the web\_only container and the nginx inside still do not support the proxy protocol. Is this correct?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 7, 2022, 12:57pm UTC](https://meta.discourse.org/t/discourse-not-support-proxy-protocol/211311/4 "2022-09-07T12:57:51Z")

</div>

I know that they use haproxy in their hosting.

Is the problem that you’re trying to solve that you want the correct ip to get to discourse? You can check topics like [How to set up Discourse on a server with existing Apache sites](https://meta.discourse.org/t/how-to-set-up-discourse-on-a-server-with-existing-apache-sites/30013) for how to configure the internal nginx to pass through the ip address.
