In this self-hosting support thread titled ‘Nginx configuration for discourse,’ user Alavi1412 seeks to run a Node.js app on port 3030 alongside Discourse on a VPS, but encounters a Rails error instead of an Nginx error when accessing /recommender. They initially edit /etc/nginx/sites-available/default, but realize Nginx may be running inside the Discourse Docker container Alavi1412. fefrei advises setting up a reverse proxy outside Docker using this guide, noting that Discourse and external apps should use different domains to avoid broken links. Alavi1412 asks if they can install the app inside the Discourse container; pfaffman replies it’s not recommended but possible, and suggests using a separate Docker container with an Nginx reverse proxy. Alavi1412 confirms they installed Discourse via the cloud install guide and asks if following the reverse proxy guide is safe and whether they should delete the existing Nginx — fefrei clarifies not to modify the Nginx inside the Discourse container Alavi1412, fefrei. Separately, terraboss asks how to configure Nginx to display PDFs inline in the browser, referencing a Stack Overflow snippet. pfaffman points to the same reverse proxy guide for modifying Nginx config inside the container. Overall, the consensus is to avoid modifying Discourse’s internal Nginx and instead use an external reverse proxy for added services.
I have isntalled discourse on a VPS. Now I want to run a nodeJS app running on port 3030 on the vps.
I have added the following to the /etc/nginx/sites-available/default:
after that, when I goto myPublicIP/recommender I received the rails error that the page does not exist. But I want to receive the nginx error.
The configuration worked well on my local but didn’t work well on vps.
If you want to host non-Discourse sites on the same host, you’ll need to set up a reverse proxy. Simply follow these steps to do so. In the end, you’ll have an nginx running outside of Docker to fiddle with
(Please note that Discourse and your external website should use different domains, or links from Discourse will break.)
No. (It’s not recommended. It would be possible, but not very easy or worthwhile.)
Yes, but if you don’t know that already, you might rather follow the link that @fefrei pointed to. If you put your app in a container, you would still need another Nginx (perhaps running in a Docker container) to reverse proxy to Discourse and your app.
@fefrei
We have installed discourse with this process.
Doing the following will solve my problem or not?
does it may cause error?
should we delete the previous nginx or not?
Are these steps SAFE?(Very Important)