Question

How do I setup ngninx on the same droplet as a manual install of Discource (forum)?

Posted January 12, 2019 370 views
NginxUbuntu 18.04

I installed discource, using this tutorial. It worked great but now when I go to www.example.com, it automatically redirects to my forum.example.com subdomain. Just example.com doesn’t seem to work.

I am now confused on what to do next to be able to create a site, using the same droplet, on my example.com domain.

I installed nginx but it gave me an error code, saying that the “Address already in use.”

All of the tutorials I am reading say to, for example, “Then, configure nginx to serve files from that directory. Open /etc/nginx/sites-available/default in your favorite text editor and update the line with the root directive such that it looks as follows:” I guess my problem might be, I have no idea how to edit get to these file and edit them in a text editor.

Appreciate any and all help y'all can throw my way.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

@kyky

You need to change the port that discourse listens on it, maybe use 8080 so you can use port 80 for Nginx.

Hope this helps.

  • Hi there, thanks for the help. So, in the app.yml, I need to change this portion:

    expose:
      - "80:80"   # http
      - "443:443" # https
    

    to

    expose:
      - "8080:80"   # http
      - "443:443" # https
    

    Correct? And then rebuild the container?

    Edit: I did that an when running nginx in the console, it says it can’t bind to the port, so I guess that didn’t work, even after rebuilding?

Submit an Answer