Discourse with reverse proxy manager

Hello there, trying to setup discourse with reverse proxy manager on nginx on one machine. Everything is accessible through my dns using default ports on the box but when setting up with reverse proxy to route traffic through my sub domain with ssl forced, it, simply does not work. I get a 502. I’m running multiple containers. proxy manager being isolated and everything discourse in another. I’ve looked through pretty much every guide I can find and nothing, works. There’s gotta be a way to successfully do this in 2025! I’ve got one site running with proxy manager and that all checks out. Do I need to hand over fpm network to discourse containers as that’s the default network that proxy manager uses to make discourse containers accessible to proxy manager? If so, where do I need to go to put that in as I cannot find any info. People say to put it in their setups but not knowing exactly where. ? I do not wanna have to change setups. I’ve seen some guides saying to not expose ports and let proxy manager do the rest, done that. I’ve seen guides saying to try and use web.socketed templates.yml in discourse/templates dir but that don’t work neither. I’ve seen people getting this to work with and with out exposing ports on discourse. Nothing seems to be consistent here. What works, and what works well nowadays. Remember ,I’m only running off of one, box.

1 like

My guess is that the proxy manager is working perfectly and that 502 error is from discourse because it’s not configured correctly.

Did you comment out the let’s encrypt and ssl templates in your yml file?

2 likes

Good news - nothing looks “broken.” yet. That 502 was almost certainly a first-boot race: Nginx tried your /srv/status before Unicorn was ready. If your logs show:

  • unicorn: run :white_check_mark:
  • Rails booted :white_check_mark:
  • Nginx error at HH:MM:SS “connection refused” (likely before Unicorn finished)

Let’s clear it up quickly.

  1. Try the status again (host → app2)
curl -sSI http://127.0.0.1:8002/srv/status
  1. If it still shows 502, just restart Nginx in app2 and test from inside the container:
docker exec -it app2 bash -lc 'sv restart nginx && sleep 2 && curl -sSI http://127.0.0.1/srv/status'
curl -sSI http://127.0.0.1:8002/srv/status

You should see HTTP/1.1 200 OK.


I got it to work. As I’m running in 2 docker containers I had to allow access to get them to see each other through a network. no ports are exposed through discourse as it’s running on internal docker ports. Plus it’s more secure.

Jonnyboy! Iphones rock!

1 like

So that’s what some AI told you. Did it work?

1 like

yes it worked, and then i announced the result in the following topic;