Running other websites on the same machine as Discourse

Is it reasonable to implement multiple discourse containers with the socketed template?

For instance, could you create and include (in, for example app2.yml) something like web.socketed2.template.yml, and swap out this line:

       listen unix:/shared/nginx.http.sock;

with:

       listen unix:/shared/nginx.http.sock2;

Then direct the reverse-proxy to connect to both?

I tried this and it didn’t work, but I’m not yet sure if this can’t work or if it’s something else in my config.

1 Like

@jetatomic discourse don’t recommended multi-site with discourse

That interpretation is a misrepresentation. What that post and several others say is that it’s an advanced topic with Pros and Cons. I have multisite with web_only and data running exactly as described in the post you referenced.

I’m just trying to learn how this works. Unix domain sockets isn’t exactly the hottest conversation on the internet.

4 Likes

Yeah, multi-container is slightly tricky because you need to update the /shared volume host path and I don’t think any of the #howto’s explicitly call that out yet. And if you have that level of trickiness, might as well just go full multisite…

1 Like

You can change the notificition email per-site, but they all have to use the same SMTP server.

Plugins do have to be the same on all multisite instances and some plugins don’t support multisite.

2 Likes

Before I came to this thread I read an article Install and Run Discourse behind Nginx the Right Way, First Time! It is already quite old (2016) so I’ll use instructions from here instead, but I was wondering about one thing. The article mentions:

We disabled the "templates/web.ratelimited.template.yml" because, our Inner Nginx tends to think only one IP address is trying to make multiple connections, which isn’t true.

See, when the Outer Nginx takes the incoming request, it funnels all the request to the Inner Nginx [the one inside Discourse docker image] as a single user from a single IP. This gives the inner Nginx the impression a user is trying to bombard it with recurring multiple requests.

This causes Nginx to go in a stalemate. Disabling this here, but enabling it in the outer Nginx will actually be what we’re looking for.

Is that still a valid argument I should take into account?

1 Like

If you’re running into that, that means correct user IPs are not making it into Discourse, which is something you should fix without removing the template.

3 Likes

Thanks! I’ll just leave it in then. I have the forum running already, and it looks good. Great instructions.

1 Like

ok, so first discourse installation is successful as per this guide, can you please tell how to setup second new discourse installation ?? @riking please help

Like do i need to create second app2.yml same like this one or use ports ?

1 Like

An app2.yml is a valid option, as is Multisite configuration with Docker .

Make sure to change the volumes: section to something other than “standalone”, e.g. “standalone2”

2 Likes

@riking Yes, i have done that(discourse2.yml “with new sub domain and new smtp”) , standalone line is changed to standalone2 and then new conf file is added to /etc/nginx/sites-enabled/discourse2.conf

bootstrap is successful and then .launcher start app and discourse2

but still only first app is online ,discourse2 is still “server unable to connect”

Do i have to add hooks in app.yml then rebuild and there is hostname in hooks which is set to b.discourse.example.com do i need to add my host as example.example.com or b.discourse.example.example.com

1 Like

Make sure that the hostnames in the nginx configuration and the container definition match?

3 Likes

checked : The .yml file app2 have same hostname, like the .conf file in nginx sites enabled

Do i need to add hooks in app.yml ?
Do i need to use same template as app.yml or i have to expose port?

Update @riking everything is working

1 Like