mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
fixed nginx include bug
This commit is contained in:
parent
e4d817503f
commit
d8bee400be
2 changed files with 16 additions and 8 deletions
|
@ -73,11 +73,25 @@ conf="$V_HOME/$user/conf/nginx.conf"
|
||||||
upd_web_domain_values
|
upd_web_domain_values
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
|
# Checking main vesta httpd config
|
||||||
|
main_conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
|
main_conf_check=$(grep "$conf" $main_conf )
|
||||||
|
if [ -z "$main_conf_check" ]; then
|
||||||
|
echo "include $conf;" >>$main_conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$SSL" = 'yes' ]; then
|
if [ "$SSL" = 'yes' ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
|
main_conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
|
main_conf_check=$(grep "$conf" $main_conf )
|
||||||
|
if [ -z "$main_conf_check" ]; then
|
||||||
|
echo "include $conf;" >>$main_conf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -81,18 +81,12 @@ conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
||||||
last_snginx=$(echo "$last_nginx" | grep "SSL='yes'")
|
last_snginx=$(echo "$last_nginx" | grep "SSL='yes'")
|
||||||
if [ -z "$last_snginx" ]; then
|
if [ -z "$last_snginx" ]; then
|
||||||
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
sed -i "/$user\/conf\/snginx.conf/d" $conf
|
||||||
if [ ! -z "$sline" ]; then
|
|
||||||
sed -i "$sline d" $conf
|
|
||||||
fi
|
|
||||||
rm -f $V_HOME/$user/conf/snginx.conf
|
rm -f $V_HOME/$user/conf/snginx.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$last_nginx" ]; then
|
if [ -z "$last_nginx" ]; then
|
||||||
line=$(grep -n "$V_HOME/$user/conf/nginx.conf" $conf | cut -f 1 -d : )
|
sed -i "/$user\/conf\/nginx.conf/d" $conf
|
||||||
if [ ! -z "$line" ]; then
|
|
||||||
sed -i "$line d" $conf
|
|
||||||
fi
|
|
||||||
rm -f $V_HOME/$user/conf/nginx.conf
|
rm -f $V_HOME/$user/conf/nginx.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue