Install Discourse as a subdirectory with existing Nginx

Hello, I’m new to Discourse and would really like to have it on my server. I also have a nginx configuration that allows to connect to a wordpress website. I do not want to have a subdomain, I just want to have this URL:
Because my server doesn’t support PostgreSQL I decided to host the Database on an external free webserver.
How would I do the nginx configuration and the configuration of the DB? Are there some guides?
Thank you so much in advance.

The first question to answer is whether you can run docker on that server. Do you have ssh access as root?

A subfolder install is fine with another instance of nginx but you will still need to install docker with nginx and postgres within the container.


You almost certainly don’t want to do that.

You should search here for the subfolder instructions. The standard install will have postgres in the container.


Thanks for your answers. Yes, I do have root and ssh access.

It’s not that it doesn’t support postgresql its more that we don’t want another database because we already have mysql. Does postgresql need much performance?

Postgres 9.6 is required. If you follow the unfussy instructions it will be installed inside the docker container with discourse, redis, and nginx.

1 Like

How would my nginx config look like? (The existing one)

You would search for the #howto document and follow these instructions: Subfolder support with Docker


So I would install it with the standard instructions and then modify the configs?

We are using discourse as a subdirectory. It works but had taken a lot of trial and error by our hosting expert.

I do not know the details. I know that he added reverse proxies and proxy passes to our nginx but that’s all I can say. We followed to documentation that pfaffman linked but even then, depending on your stack there’s a lot of customization to do.

I would not recommend unless you have resources to invest into it.


1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.