Page 1 of 1

Nginx reverse proxy for NodeJs

Posted: Sun Oct 14, 2018 12:35 am
by chrisf
Greetings! I was a long term user of KloxoMR, but have moved to a Ubuntu box. Vesta is very very clean. I am amazed! :-)

I have 8 domains, all running well. One of the domains must reverse proxy nodejs - not Apache. I am looking for a solution that will not get wiped or removed if I need to rebuild the web.

location / {
proxy_pass http://private_ip_address:9090;
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;
}

If I change the domain file in nginx to the above, will changes persist?

Thank you and thank you for a great panel!

Chris

Re: Nginx reverse proxy for NodeJs

Posted: Mon Oct 15, 2018 10:14 am
by mehargags
just create a template with name 'nodeJSrevproxy' with your config and place it here

Code: Select all

/usr/local/vesta/data/templates/web/nginx
You can make a copy of one of the existing templates and reuse its variables, will be easier.

Once template is made, restart vesta and choose Nginx template from WebUI for the domain.

Re: Nginx reverse proxy for NodeJs

Posted: Mon Oct 15, 2018 8:36 pm
by chrisf
That is great! Thank you very much.

I have a lot to learn about Vesta, the template system is nice.

[Edit]
I thought by seecting solved it would just mark the topic, but it marked my post. The post above is the answer :-)

Re: Nginx reverse proxy for NodeJs

Posted: Tue Oct 16, 2018 12:47 am
by chrisf
Worked perfectly. Easy to undertand, stpl for ssl ,tpl normal... nice :-)

Thank you again!