How to make Discourse coexist with nginx on a Debian 9 server?

AI-generated summary

A user, unfa, is trying to set up a server with Discourse and nginx on Debian 9. After temporarily renaming the Discourse directory (/var/discourse), nginx started working, suggesting that Discourse had taken over the server’s http port. unfa wants to host a main landing page on the domain and put Discourse on a subdomain.

itsbhanusharma provided a link to an article on meta.discourse.org, which should answer all questions regarding running other websites alongside Discourse.

Alternatively, itsbhanusharma suggested stopping the Discourse app using ./launcher stop app instead of breaking the directory structure.

Hi!

I’m a noob when it comes to setting up servers, so please forgive my ignorance, I’m trying to learn. I’ve been using Linux for a decade for media production, but setting up web services is a different beast apparently.

I’ve installed Discourse on my server running Debian 9. Later I installed nginx to put a simple website there, which will later provide visitors with a link to a subdomain hosting the Discourse server.

I’ve temporarily renamed /var/discourse to /var/_discourse and after a reboot nginx works. before it seemed that Discourse has hijacked the server’s http port.

However I’m still wondering how to make the two work together later.
I’ll probably want to put a main landing page on my domain and put the Discourse on a subdomain there.

I’d be grateful for any help with this.

I guess I could point nginx to a directory with Discourse’s index.html and make it expose that on a subdomain, right?

How do I make the two work together?

This article shall answer all your questions:

Thanks!
I’ve just updated my initial post, I’ll check this link out.

Your solution is to actually break Discourse directory structure to prevent it from starting up.

You could simply stop it through
./launcher stop app