U
U
ura2rist2020-01-02 19:26:04
Node.js
ura2rist, 2020-01-02 19:26:04

How to run a NODE application on vestacp?

I installed vestacp, I'm trying to run a simple node js application on it

const express = require('express'),
  app = express(),
  port = 3000;

app.get('/',(request,response)=>{
  console.log('sdf');
})

app.listen(port,(err)=>{
  if(err){
    console.log(err);
  }
  console.log('Сервер работает');
})

It starts but when I go to the tab at the address: port - nothing is written to the console, if I do the same send, nothing happens.
Only writes Unable to access the site
How to run the application
The contents of the nginx settings file
server {
listen 93.170.130.182:80;
server_name 93.170.130.182 www.93.170.130.182;
error_log /var/log/apache2/domains/93.170.130.182.error.log error;
location / {
proxy_pass http://93.170.130.182:8080;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|odt|ods|odp |odf|tar|wav|bmp|rtf|js|mp3|avi|mpeg|flv|html|htm)$ {
root /home/admin/web/93.170.130.182/public_html;
access_log /var/log/apache2/domains/93.170.130.182.log combined;
access_log /var/log/apache2/domains/93.170.130.182.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/93.170.130.182/document_errors/;
}
location @fallback {
proxy_pass http://93.170.130.182:8080;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include /home/admin/conf/web/nginx.93.170.130.182.conf*;
}
server {
listen 93.170.130.182:443;
server_name site.com www.site.com;
ssl on;
ssl_certificate /home/admin/conf/web/ssl.site.pem;
ssl_certificate_key /home/admin/conf/web/ssl.site.key;
error_log /var/log/apache2/domains/site.error.log error;
location / {
proxy_pass http://93.170.130.182:3000;
}
}

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