Solved How to host my Nodejs app ? Getting 503 error

cipcip

Verified User
Joined
Nov 22, 2024
Messages
7
Location
home
Hello ,

I am new to direct admin and it is the first time I am attempting to host my Nodejs app on DirectAdmin , I used the same type of setup I had on Plesk where it worked fine .

So , besides app.js , I have a server.js file which I am serving to create the server to run it , like so :

const app = require('./app');
const http = require('http');
const dotenv = require('dotenv');
dotenv.config();
http.createServer(app).listen(process.env.PORT);


Then , in the Create Application page in Nginx Unit , I have this :


1748343138247.png

1748343178583.png

1748343198805.png


note the server.js added on the second page of the configuration ...

Now for the route :

1748343228638.png



What am I doing wrong ?!

Please help me on this .

Thank you,
Cristian
 
Update , if I go into remote connection and go to the domain path and type: node server.js , the app starts without issues and i get the output of : connected to sql , as I have some echo in place ... but the web browser still gives 503 error . Why is that ?
 
Back
Top