Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

node.js

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
orgolan
Posts: 8
Joined: Sat Apr 25, 2020 7:32 pm

Os: Ubuntu 17x
Web: apache + nginx
node.js
  • Quote

Post by orgolan » Sat Apr 25, 2020 7:57 pm

hi,

does someone has step by step guide to how to create a simple hello world node.js app in a server which contain vestacp.

which web template to choose?
i see there is nginx support but not as web template but as proxy support.

anyone?
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: node.js
  • Quote

Post by grayfolk » Sat Apr 25, 2020 8:43 pm

orgolan wrote: ↑
Sat Apr 25, 2020 7:57 pm
hi,

does someone has step by step guide to how to create a simple hello world node.js app in a server which contain vestacp.

which web template to choose?
i see there is nginx support but not as web template but as proxy support.

anyone?
You should create your own nginx template for nodejs.
Like this example:

Code: Select all

server {
    listen      %ip%:%web_ssl_port% ssl http2;
    server_name %domain_idn%;
    root        %home%/%user%/nodejsroot/public;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    include     %home%/%user%/conf/web/snginx.%domain%.conf*;
}
Top

orgolan
Posts: 8
Joined: Sat Apr 25, 2020 7:32 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: node.js
  • Quote

Post by orgolan » Sun Apr 26, 2020 8:13 am

grayfolk wrote: ↑
Sat Apr 25, 2020 8:43 pm
orgolan wrote: ↑
Sat Apr 25, 2020 7:57 pm
hi,

does someone has step by step guide to how to create a simple hello world node.js app in a server which contain vestacp.

which web template to choose?
i see there is nginx support but not as web template but as proxy support.

anyone?
You should create your own nginx template for nodejs.
Like this example:

Code: Select all

server {
    listen      %ip%:%web_ssl_port% ssl http2;
    server_name %domain_idn%;
    root        %home%/%user%/nodejsroot/public;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    include     %home%/%user%/conf/web/snginx.%domain%.conf*;
}
hi thanks for the answer.
correct me if i'm wrong but this template only support port 3000?
any chance that can be configured for mulituple website using the same template?
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: node.js
  • Quote

Post by grayfolk » Sun Apr 26, 2020 11:10 am

orgolan wrote: ↑
Sun Apr 26, 2020 8:13 am

hi thanks for the answer.
correct me if i'm wrong but this template only support port 3000?
any chance that can be configured for mulituple website using the same template?
Again: You should create your own nginx template for nodejs.
So, you can specify any port.
Top

mylastore
Posts: 8
Joined: Sun Jun 21, 2020 1:02 am

Os: Ubuntu 17x
Web: apache + nginx
Re: node.js
  • Quote

Post by mylastore » Sun Nov 29, 2020 4:40 am

I added the node.tpl but is not showing on the vestacp. What am I missing?
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: node.js
  • Quote

Post by grayfolk » Sun Nov 29, 2020 6:49 am

mylastore wrote: ↑
Sun Nov 29, 2020 4:40 am
I added the node.tpl but is not showing on the vestacp. What am I missing?
You was added it into wrong folder.
Top

danlevy
Posts: 1
Joined: Wed Dec 09, 2020 4:56 am

Os: Debian 7x
Web: apache + nginx
Re: node.js
  • Quote

Post by danlevy » Wed Dec 09, 2020 4:59 am

orgolan wrote: ↑
Sat Apr 25, 2020 7:57 pm
hi,

does someone has step by step guide to how to create a simple hello world node.js app in a server which run 3 contain vestacp.

which web template to choose?
i see there is nginx support but not as web template but as proxy support.

anyone?
Make sure you create your own nginx template for nodejs and add it in the right folder.
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password