Let’s say you have a WordPress blog on http://=DOMAIN=, and you want to serve your Discourse forums (which run on a different server) from http://=DOMAIN==PATH=. How do you do that?
Note: This won’t work for serving multiple Discourse instances from different folders on the same domain. You need to use different subdomains so that each site can have different cookies.
You’re going to need to send all traffic for the domain to one place that can route traffic to the correct server. In this how-to, I’ll use Fastly. So, Discourse will be running on one server, and the other parts of your site (like WordPress) will run on one or more other servers.
Now to setup Fastly to send traffic to the right place based on the path. I’ll assume that Discourse is being served from =PATH=.
Create a new service pointing to your main website and follow the instructions for updating your DNS settings.
Go to the service and click “Configure”. Make sure you have selected Version 2 so that you can make changes. Version 1 is the currently active version and can’t be changed.
In the “Hosts” section, add your Discourse server as a second backend.
Is a service like Fastly required to have Discourse (running in a Docker container) served from a subfolder and have Wordpress on the host server?
I followed the directions to serve Discourse from a subfolder, and modified my host nginx configuration file, and it sort of works, but there are loose ends. Some assets are served correctly, but others aren’t (they’re missing the Discourse folder name).
Before I dig much deeper, is what I am trying to do even possible?
Now i struggle how to configure nginx to redirect all request to example.com/forum to the discourse docker and all other (Example Domain or example.com/app) to the nginx folder for the website.
I found a solution how to run discourse with docker with subfolder installation (example.com/forum) and serve other site content (Example Domain or example.com/otherContent) with nginx on the same machine. … and it’s with https
You must install and configure nginx on this server, pointing to the discourse installation. Here is a good tutorial to do this: https://serversforhackers.com/video/installing-discourse-with-docker. You don’t need to divide the Discourse installation in three containers if you don’t want it, just follow the steps to expose the web container in a different port than 80.
Finally, this configuration works for me, you are free to use it if it fits for you: