ee_lib_git /etc/nginx/ "Before ee site update: $EE_DOMAIN running on $EE_SITE_CURRENT_OPTION"
ee_lib_git /etc/nginx/ "Before ee site update: $EE_DOMAIN running on $EE_SITE_CURRENT_TYPE"
# Update NGINX configuration
ee_lib_echo "Updating $EE_DOMAIN, please wait..."
@ -30,7 +27,7 @@ function ee_mod_update_nginx()
sed -i "s'$ee_nginx_current_header'$ee_nginx_update_header'" /etc/nginx/sites-available/$EE_DOMAIN|| ee_lib_error "Unable to update nginx configuration to $EE_SITE_CREATE_OPTION, $EE_SITE_CACHE_OPTION for $EE_DOMAIN, exit status ="$?
# Update NGINX conf for HTML site
if["$EE_SITE_CURRENT_OPTION"="HTML"];then
if["$EE_SITE_CURRENT_TYPE"="--html"];then
sed -i 's/access\.log/access.log rt_cache/' /etc/nginx/sites-available/$EE_DOMAIN&&\
sed -i '/index index.html index.htm;$/c \\tindex index.php index.htm index.html;' /etc/nginx/sites-available/$EE_DOMAIN&&\
sed -i '/location \/ {/,/}/d ' /etc/nginx/sites-available/$EE_DOMAIN\
@ -55,7 +52,7 @@ function ee_mod_update_nginx()
fi
# Update PHP MySQL --basic (--wp/--wpsubdir/--wpsubdomain) to --wpsc --w3tc --wpfc options
sed -i 's/include common\/php.conf/include common\/wpsc.conf/' /etc/nginx/sites-available/$EE_DOMAIN\
|| ee_lib_error "Unable to update NGINX configuration to $EE_SITE_CREATE_OPTION$EE_SITE_CACHE_OPTION, exit status ="$?
@ -68,7 +65,7 @@ function ee_mod_update_nginx()
fi
# Update --wpsc (--wp/--wpsubdir/--wpsubdomain) to --basic --w3tc --wpfc options
elif["$EE_SITE_CURRENT_OPTION"="WPSINGLE WP SUPER CACHE"]||["$EE_SITE_CURRENT_OPTION"="WPSUBDIR WP SUPER CACHE"]||["$EE_SITE_CURRENT_OPTION"="WPSUBDOMAIN WP SUPER CACHE"];then
sed -i 's/include common\/wpsc.conf/include common\/php.conf/' /etc/nginx/sites-available/$EE_DOMAIN\
|| ee_lib_error "Unable to update NGINX configuration to $EE_SITE_CREATE_OPTION$EE_SITE_CACHE_OPTION, exit status ="$?
@ -81,7 +78,7 @@ function ee_mod_update_nginx()
fi
# Update --w3tc (--wp/--wpsubdir/--wpsubdomain) to --basic --wpsc --wpfc options
elif["$EE_SITE_CURRENT_OPTION"="WPSINGLE W3 TOTAL CACHE"]||["$EE_SITE_CURRENT_OPTION"="WPSUBDIR W3 TOTAL CACHE"]||["$EE_SITE_CURRENT_OPTION"="WPSUBDOMAIN W3 TOTAL CACHE"];then
sed -i 's/include common\/w3tc.conf/include common\/php.conf/' /etc/nginx/sites-available/$EE_DOMAIN\
|| ee_lib_error "Unable to update NGINX configuration to $EE_SITE_CREATE_OPTION$EE_SITE_CACHE_OPTION, exit status ="$?
@ -94,7 +91,7 @@ function ee_mod_update_nginx()
fi
# Update --wpfc (--wp/--wpsubdir/--wpsubdomain) to --basic --wpsc --w3tc options
elif["$EE_SITE_CURRENT_OPTION"="WPSINGLE FAST CGI"]||["$EE_SITE_CURRENT_OPTION"="WPSUBDIR FAST CGI"]||["$EE_SITE_CURRENT_OPTION"="WPSUBDOMAIN FAST CGI"];then
sed -i '/include common\/locations.conf/i \\tinclude common\/wpcommon.conf;' /etc/nginx/sites-available/$EE_DOMAIN|| ee_lib_error "Unable to update nginx configuration to $EE_SITE_CREATE_OPTION, $EE_SITE_CACHE_OPTION for $EE_DOMAIN, exit status ="$?
fi
@ -116,10 +113,10 @@ function ee_mod_update_nginx()
# Update server_name for HTML PHP MYSQL WP (single site) only
sed -i "s'server_name $EE_DOMAIN www.$EE_DOMAIN;'server_name $EE_DOMAIN *.$EE_DOMAIN;'" /etc/nginx/sites-available/$EE_DOMAIN&&\
sed -i '/server_name.*;/i \\t# Uncomment the following line for domain mapping;\n\t# listen 80 default_server;\n' /etc/nginx/sites-available/$EE_DOMAIN&&\