Can't access Discourse when moving behind reverse-proxy


(Jason Nall) #1

I had a Discourse server running standalone on a DO droplet, mostly following the 30-minute install tutorial. Everything was working correctly.

As part of an infrastructure upgrade where I’m moving to multiple services running on multiple DO droplets, I set up a new droplet to act as a proxy server, changed my DNS to point to the new server, and configured nginx with the same config as seen here, except I added the SSL certs I used on the standalone server. Previously I had been using SSL and redirecting non-https requests.

I changed my app.yml to forward a different port to port 80 (and removed 443, since the standalone should only be taking proxy traffic and the reverse proxy handles SSL), and commented out the ssl template that was included.

Now the issue is that I cannot access this Discourse install at all. I have tried CURLing to the port in question on the host server, from the proxy server, from my local machine, and I have tried using the private network IP from the proxy server. I get connection refused errors each time. I have also tried CURL with the host header set as I would expect it to be from the nginx proxy, and that has not worked either.

Of course, the end goal is to make the new site available from the reverse proxy, but at this point I can’t get my Discourse online and working if I can’t even get a response from the docker install with CURL.

Any ideas as to what I may doing wrong?


(Jason Nall) #2

I resolved the issue. The primary reason for this was due to extra code executed from app.yml that had modified the nginx state in docker. Subsequent launches of the app kept the modified nginx configuration even when app.yml was returned to its normal state.

The lesson to be learned here is to use ./launcher rebuild when you need to do a hard reset of your docker state to get rid of outstanding changes made in the docker container.


(Jeff Atwood) #3