Help understanding the structure of using discourse + static website


(Tyler Schuett) #1

Forgive me if this is really juvenile. I’m new to ruby dev.

So I have a beautiful installation of discourse up and running on digitalocean. I am waiting for my DNS servers to propogate now that I’ve directed them at my discourse IP on digitalocean.

The forum is working beautifully.

How and where can I build static content of the website around discourse?
E.g., I want someone to hit a static page prior to going to discourse, and then click "forum’ in the nav.

Normally I would just open up the host and add the pages there, but I’m unsure how to do that on digitalocean.


(⛰️) #2

I am thinking that depends on if a subdomain is pointing to your Discourse install (eg, discourse.mydomain.com). If you want your top-tier domain (mydomain.com) to have that link, then you only need to make a server block for mydomain.com and your static page.


(Tyler Schuett) #3

Hey purldator, thanks for taking some time to help me out.

Here is the structure I’d like to have:

mydomain.com

  • contains all the static site stuff

discourse.mydomain.com

  • contains discourse

I want to just link to ‘discourse.mydomain.com’ from ‘mydomain.com’ and then have the same header on ‘discourse.mydomain.com’ if that makes sense.

Do I just need to point my subdomain at the discourse IP address?
Will that work properly?
Is there anything I need to do with the NS records?

Thanks again.


(⛰️) #4

Here’s a completed example file for Nginx to be in front of the Docker container and delegate where the client goes based on if they call discourse.mydomain.com or mydomain.com. At the bottom of that file, you want to make a second server block for mydomain.com. Go to the link I have in my first post and check out the section titled Create a NGINX ‘site’. That shows you how to create the server block for your top-level domain. Or, you can also check out this DO tutorial for the exact same thing, which shows you how to test the new server block.

As for the NS records, your sub domain needs to point to your DO droplet’s IP address. Because Nginx is the one pointing the client to the correct site, based on if they call discourse.mydomain.com or just mydomain.com. This link clarifies what I mean.

EDIT: As for the header, this might be what you’re looking for as it was asked today from someone else too.


Is it necessary to install nginx in front of docker?