Help understanding the structure of using discourse + static website

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.

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

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

Here is the structure I’d like to have:

example.com

contains all the static site stuff

discourse.example.com

contains discourse

I want to just link to discourse.example.com from example.com and then have the same header on discourse.example.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.

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 example.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.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.