How to make a copy of nodejs-nginx-template with another port

Post Reply
User avatar
isscbta
Team Member
Posts: 132
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 17 times
Been thanked: 3 times

Let's suppose that you have a nodejs-nginx-template that is targeting port 3000, and you want to make another nginx template to target port 3001

In your SSH, as root, run:

Code: Select all

FROM='3000'
TPL='node-app-3000'
TO='3001'
After that, run:

Code: Select all

NTPL=${TPL/$FROM/$TO}
cp /usr/local/vesta/data/templates/web/nginx/$TPL.stpl /usr/local/vesta/data/templates/web/nginx/$NTPL.stpl
cp /usr/local/vesta/data/templates/web/nginx/$TPL.tpl /usr/local/vesta/data/templates/web/nginx/$NTPL.tpl
sed -i "s|$FROM|$TO|g" /usr/local/vesta/data/templates/web/nginx/$NTPL.stpl
sed -i "s|$FROM|$TO|g" /usr/local/vesta/data/templates/web/nginx/$NTPL.tpl

Tags:
Post Reply