Run other websites on the same machine as Discourse

So you want to Serve Discourse from a subfolder (path prefix) instead of a subdomain?

1 Like

Cool. Sounds like what I’m looking for. Thanks.

1 Like

How can I get in this ?? I mean how do I find that part?? There are 2 sets of same lines! Which are meant to edit or change??

EDIT from here:

Never mind dude …! Thanks for your time! I figured it out myself :upside_down_face:

BTW. your way isn’t quite working

2 Likes

U also need to setup the env variables at least in discourse 3…

open your app.yml

and look for the env variables and fill them.

Thx for this,
i setup first discourse standalone, which shows me the correct register page in http. I than installed nginx but without cert, because i uses in test lab without Lets Encrypt access. I now see the register page, but without styling. In ngix logs on host i see 404 errors. Any idea to solve this?
thx
Solved: i have to comment out try_files $uri $uri/ =404;", which is default under debian 11 and nginx 18.0-6.

1 Like

Erros. After I setting this, the Chrome browser show erros:

Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure font '<URL>'. This request has been blocked; the content must be served over HTTPS.

1 Like

Did you turn on force_https?

1 Like

Yes I did it on the certbot --nginx step. And I’ve tried many time, didn’t work.

You need to set the discourse setting force_https, not on nginx. Best to do it with an env variable, but you can do it in the ux if your can get into admin/settings.

2 Likes

I followed the steps above and successfully ran nginx, but when accessing the URL, I received an ERR_TOO_MANY_REDIRECTS error.


Screenshot from 2023-05-17 12-23-12
Can anyone help me understand why?

bind() to unix:/shared/nginx.http.sock failed (95: Operation not supported)

So I’m confused I can’t run /discourse-setup because I’m installing it on an existing webserver yet I am supposed to edit a .yml file that doesn’t get created unless I run /discourse-setup. So app.yml doesn’t exist, therefore how do I edit it?

Copy standalone.yml from the samples directory.

I feel like an idiot after having gone through this post twenty times and missed that the last line in that section said “Added”. Might I suggest @riking could you modify the intro to be like this:

1 Like

I made the suggested change (and deleted posts about whether it was a wiki that apparently your trust level keeps you from editing–sorry about that). It’s a subtle change, but I think it might help others. Thanks.

2 Likes

I have a slightly different setup: My reverse proxy is not running on the host machine, but in a separate docker container.
I’m currently using a docker network to connect those two, so not exposing discourse via unix socket.

Works fine, but has a significant drawback: The rate limiting only sees the IP of the reverse proxy and therefore erroneously rate limits the reverse proxy…

I see several options:

  1. Remove rate limiting template. (Not a great option…)
  2. Create my own template that configures nginx to set_real_ip_from the reverse proxy.
  3. Adjust rate limiting template to use $http_x_forwarded_for instead of $binary_remote_addr.
  4. Expose the unix socket in the reverse proxy container. (Don’t know, if/how it is possible.)

Ideally, I would not create my own template or change existing ones but use the default setup as close as possible, i.e. option 4.

Any idea? Pros/cons? Thoughts?

I understand you had this issue a long time ago, but I just ran into it tonight and I found a solution that worked for me.

My issue was with my registrar acting as a proxy with SSL/TLS settings set to “flexible.” Switching it to “Full” resolved the issue immediately—I just wish it had occurred to me prior to rebuilding ~20 times.

1 Like

What is meant by a two-container installation? Thank you.

1 Like

A container is a docker concept and is effectively an isolated processing unit that can have independent configuration from the operating system.

Normally Discourse and all its dependencies (in the standard install) run in a single container.

There are more advanced installations where others services can run in another container and even one where Discourse is split across two (one for database and one for web) - a “two container install”

NB Discourse uses its own bespoke launcher that is not quite the same as used by vanilla docker

3 Likes