Discourse not support proxy_protocol

AI-generated summary

Discussion participants are seeking support for the proxy_protocol in Discourse. shihuang214 notes that Discourse does not currently support this protocol, which is used by HAProxy and NGINX for load balancing and SSL termination. A proposed solution in the form of a Pull Request is mentioned, but RGJ suggests handling it similarly to how Cloudflare is handled.

Thomas_Rother shares their setup, which includes HAProxy, Apache2, and NGINX, and expresses interest in implementing the proxy protocol. However, they note that the web_only container and NGINX inside do not appear to support the proxy protocol.

pfaffman suggests that the underlying problem may be about passing the correct IP address to Discourse, and points to a relevant topic on configuring internal NGINX to pass through the IP address.

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

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

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

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.

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

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 for how to configure the internal nginx to pass through the ip address.