A
A
Alexander Koshelev2018-10-13 19:09:51
Nginx
Alexander Koshelev, 2018-10-13 19:09:51

How to transfer a node.js web application to vps?

Good afternoon everyone, please help, and I hope for your tolerance! I rebuilt the server several times already, I didn’t understand why my application didn’t work, although a single file was launched and displayed on the Hello World domain address, but the whole project didn’t give a damn, it gave out 502 then 504
Ubuntu 18.0, nginx, is a brief description of what I work with .
I created a wiretap on port 443, made virtual hosts on the domain, hung up the html file in /var/www/site.com/ , everything works, html is loaded on the domain via https.
This is from sites-available config

server {
listen 80;
listen [::]:80;
root /var/www/site.com/html;
index index.html index.htm index.nginx-debian.html;
server_name site.com www.site.com;
location / {
try_files $uri $uri/ =404;
}
}

I made a symlink on site-enable, in general, so far everything is fine.
In my project there is a database, postgress, is the 502 error a consequence of the fact that I didn’t install sql and specifically postgress?
Please help, write the order of actions that I should do next, and where is it better to put node.js? to the /var/www/ folder? and then make different project folders at /var/www/proekt1-2 so that they all work? I just put the node once in /home/myUser/ and nothing worked for me from the folders /var/www/proekt
Question!!!!!!!!!!
Where to put the node? Do I need to put sql and then postgress (like phpmyadmin to work)? Using ufw to listen to a port with postgress?
Please help please!!!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question