Vesta 2.0 is coming soon! See our progress update: https://vestacp.com/docs/vesta-2-update
node.js
node.js
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?
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?
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: node.js
You should create your own nginx template for nodejs.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?
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*;
}
Re: node.js
hi thanks for the answer.grayfolk wrote: Sat Apr 25, 2020 8:43 pmYou should create your own nginx template for nodejs.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?
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*; }
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?
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: node.js
Again: You should create your own nginx template for nodejs.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?
So, you can specify any port.
Re: node.js
I added the node.tpl but is not showing on the vestacp. What am I missing?
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: node.js
You was added it into wrong folder.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?
Re: node.js
Make sure you create your own nginx template for nodejs and add it in the right folder.