I read the last programmer’s documents for me and it says because many things of the web running behind nginx and discourse also needs to be hosted behind nginx. The standard install doesn’t work for my situation.
and the following is how he said in the document and how he did:
Discourse runs in a docker container. However, it requires a special kind of configuration, not via a docker-compose.yml or a .conf file.
The discourse-project/ the github repository required to config and build the docker-image can be found here. Ignore the nice and juicy “discourse-setup” program they provide, that won’t work here. We need to configure the app ourselves.
- clone discourse_docker to /var/discourse:
git clone https://github.com/discourse/discourse_docker.git /var/discourse
- go to the folder and use a provided sample configuration:
cd /var/discourse && cp samples/standalone.yml containers/app.yml
- then edit the containers/app.yml file (e.g. with
sudo nano
)
- Changes were made to the hosting section, the smtp settings for mail and - important - the expose section so only an unused port is exposed to the outside
- To run discourse on a path such as “/forum” some more changes were needed as described here
- Some problems also occur with the email-authentication:
- The mail that sends emails is here “server’s email”. However, Discourse expects the mail to have the same domain as its host, namely “server’s email”
- Solution described here
- Also use “DISCOURSE_SMTP_AUTHENTICATION: login” as another env option. Why also always . . .
- The mail that sends emails is here “server’s email”. However, Discourse expects the mail to have the same domain as its host, namely “server’s email”
- Then build the app from the
/var/discourse
directory withsudo ./launcher bootstrap app
. This takes quite a while - Then you may be able to start the discourse container with
sudo ./launcher start app
.