mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Enhance proxy template selection in v-activate-rocket-nginx to include wprocket-webp-express-force-https option and update install script to download corresponding templates.
This commit is contained in:
parent
2f8692bb21
commit
29236cfb03
3 changed files with 17 additions and 5 deletions
|
@ -75,18 +75,20 @@ fi
|
|||
# Changing Proxy Template
|
||||
# Check if the proxy template is already set correctly
|
||||
current_template=$(/usr/local/vesta/bin/v-list-web-domain $user $domain | grep 'PROXY:' | awk '{print $2}')
|
||||
if [ "$current_template" == "wprocket-force-https" ] || [ "$current_template" == "wprocket-hosting" ]; then
|
||||
if [ "$current_template" == "wprocket-force-https" ] || [ "$current_template" == "wprocket-hosting" ] || [ "$current_template" == "wprocket-webp-express-force-https" ]; then
|
||||
echo "Proxy Template is already set up correctly"
|
||||
else
|
||||
# Prompt the user to choose whether to force HTTPS or not
|
||||
echo "Do you want to force-https in your Proxy Template or not (y/n):"
|
||||
echo "Do you want to use wprocket-hosting template, wprocket-force-https template or wprocket-webp-express-force-https template (h/f/w):"
|
||||
read answer
|
||||
|
||||
# Change the proxy template based on the user's choice
|
||||
if [ "$answer" == "y" ]; then
|
||||
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-force-https"
|
||||
else
|
||||
if [ "$answer" == "h" ]; then
|
||||
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-hosting"
|
||||
elif [ "$answer" == "f" ]; then
|
||||
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-force-https"
|
||||
elif [ "$answer" == "w" ]; then
|
||||
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-webp-express-force-https"
|
||||
fi
|
||||
|
||||
echo "Proxy Template is ready"
|
||||
|
|
|
@ -4,6 +4,8 @@ wget -nv -O /usr/local/vesta/data/templates/web/nginx/wprocket-force-https.tpl h
|
|||
wget -nv -O /usr/local/vesta/data/templates/web/nginx/wprocket-force-https.stpl https://c.myvestacp.com/tools/rocket-nginx-templates/wprocket-force-https.stpl
|
||||
wget -nv -O /usr/local/vesta/data/templates/web/nginx/wprocket-hosting.tpl https://c.myvestacp.com/tools/rocket-nginx-templates/wprocket-hosting.tpl
|
||||
wget -nv -O /usr/local/vesta/data/templates/web/nginx/wprocket-hosting.stpl https://c.myvestacp.com/tools/rocket-nginx-templates/wprocket-hosting.stpl
|
||||
wget -nv -O /usr/local/vesta/data/templates/web/nginx/wprocket-webp-express-force-https.tpl https://c.myvestacp.com/tools/rocket-nginx-templates/wprocket-webp-express-force-https.tpl
|
||||
wget -nv -O /usr/local/vesta/data/templates/web/nginx/wprocket-webp-express-force-https.stpl https://c.myvestacp.com/tools/rocket-nginx-templates/wprocket-webp-express-force-https.stpl
|
||||
|
||||
echo "Updating apt, please wait..."
|
||||
apt-get update > /dev/null 2>&1
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
server {
|
||||
listen %ip%:%proxy_port%;
|
||||
server_name %domain_idn% %alias_idn%;
|
||||
location / {
|
||||
rewrite ^(.*) https://$host$1 permanent;
|
||||
}
|
||||
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue