How to make a copy of nodejs-nginx-template with another port
Posted: Mon Aug 29, 2022 10:35 am
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:
After that, run:
In your SSH, as root, run:
Code: Select all
FROM='3000'
TPL='node-app-3000'
TO='3001'
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