Page 1 of 1

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

Posted: Mon Aug 29, 2022 10:35 am
by isscbta
Let's suppose that you have nodejs-nginx-template with port 3000 and you want to extend this to port 3001

In your SSH, as root, run:

Code: Select all

FROM='3000'
TO='3001'
After that, run:

Code: Select all

cp /usr/local/vesta/data/templates/web/nginx/node-app-$FROM-pass-to-https.stpl /usr/local/vesta/data/templates/web/nginx/node-app-$TO-pass-to-https.stpl
cp /usr/local/vesta/data/templates/web/nginx/node-app-$FROM-pass-to-https.tpl /usr/local/vesta/data/templates/web/nginx/node-app-$TO-pass-to-https.tpl
sed -i "s|$FROM|$TO|g" /usr/local/vesta/data/templates/web/nginx/node-app-$TO-pass-to-https.stpl
sed -i "s|$FROM|$TO|g" /usr/local/vesta/data/templates/web/nginx/node-app-$TO-pass-to-https.tpl