Help understanding the structure of using discourse + static website

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