Unable to get nginx to work together

(charles) #1

Have been struggling for hours and need some guidance

SSL is working with default nginx via /var/www/html
Discourse works with http://www.example.com:25654/

Once I switch to the nginx config (copied from DO and modified) and reload, I get 502 Bad Gateway but once I switch back to default nginx config, everything is working again

Here’s the nginx config


(charles) #2

Several more hours spent trying to make it work.

Right now it’s one (nginx works when discourse launcher stop) or discourse works with nginx stopped.

I can only guess that it’s the config from DO that is causing the problem.

Only want to run nginx and discourse. Can anyone suggest things to look into?


You have both nginxes running on same ports maybe?

You should check this guide

(charles) #4

The confusing parts is that the guide list Change the container definition and also Create an NGINX ‘site’ for the outer nginx which is not included in the DO guide.

For example, the @riking guide has a different location / as well as removal of port 80:80 and DO shows to change instead of remove.

Very confusing which to follow and what to apply over the other


Yes because DO guide connects to your discourse nginx through IP, while the other guide connects through socket. I had no problem following guide from this forum. I alos believe it’s better solution, since you don’t “spam” your network with opening random ports.

(charles) #6

Spent whole day, multiple retries and gave up. Will just get a new droplet going and try different method suggested.