Skip to content

Commit 30512ea

Browse files
committed
added nginx support
1 parent 4a4dcb1 commit 30512ea

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

bin/v_rebuild_web_domains

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,24 @@ for domain in $domains; do
108108
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot
109109
fi
110110
fi
111+
112+
# Checking nginx
113+
nginx=$(get_web_domain_value '$NGINX')
114+
if [ ! -z "$nginx" ]; then
115+
proxy_port=$(get_config_value '$PROXY_PORT')
116+
ext=$(get_web_domain_value '$NGINX_EXT')
117+
tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.tpl"
118+
conf="$V_HOME/$user/conf/tmp_nginx.conf"
119+
add_web_config
120+
121+
if [ ! -z "$cert" ]; then
122+
proxy_ssl_port=$(get_config_value '$PROXY_SSL_PORT')
123+
tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.stpl"
124+
conf="$V_HOME/$user/conf/tmp_snginx.conf"
125+
add_web_config
126+
fi
127+
fi
128+
111129
done
112130

113131
# Renaming tmp config
@@ -137,6 +155,29 @@ if [ ! -z "$ssl_cert" ]; then
137155
fi
138156
fi
139157

158+
# Checking nginx
159+
if [ ! -z "$nginx" ]; then
160+
nginx_conf='/etc/nginx/conf.d/vesta_users.conf'
161+
tmp_conf="$V_HOME/$user/conf/tmp_nginx.conf"
162+
conf="$V_HOME/$user/conf/nginx.conf"
163+
mv $tmp_conf $conf
164+
165+
nginx_conf_check=$(grep "$conf" $nginx_conf )
166+
if [ -z "$nginx_conf_check" ]; then
167+
echo "include $conf;" >>$nginx_conf
168+
fi
169+
170+
# Checking ssl for nginx
171+
if [ ! -z "$ssl_cert" ]; then
172+
tmp_conf="$V_HOME/$user/conf/tmp_snginx.conf"
173+
conf="$V_HOME/$user/conf/snginx.conf"
174+
mv $tmp_conf $conf
175+
nginx_conf_check=$(grep "$conf" $nginx_conf )
176+
if [ -z "$nginx_conf_check" ]; then
177+
echo "include $conf;" >>$nginx_conf
178+
fi
179+
fi
180+
fi
140181

141182
#----------------------------------------------------------#
142183
# Vesta #

0 commit comments

Comments
 (0)