What's the proper way to set up Discourse behind a reverse proxy?


(Sean Whalen) #1

I’d like to set up ningix on my docker host to be a reverse proxy for my Discourse web-only container, so that I can host sites other than Discourse on the same host. I know I need to modify the expose section, but what about DISCOURSE_HOSTNAME? Will Discourse except connections from 127.0.0.1 from the reverse proxy if DISCOURSE_HOSTNAME is set to something like forum.example.com?


(Sam Saffron) #2

if you expose a port/ip, all traffic for that port will be handled. The only issue you need to resolve is IP forwarding. So you need to customize NGINX to allow for the forwarded IP addresses so it does not look like all traffic is coming from 1 IP, there is a post here on meta covering that.


(A. A.) #3

@sam I couldn’t find the post. Can you post it here?


(cpradio) #4

I believe he is referring to this one