ssl for wp-mu-subdom
fixed, now we can add ssl certs to wordpress multisite with subdomain setup subsites.
This commit is contained in:
parent
1f275f0172
commit
cf38ef4b1c
1 changed files with 18 additions and 0 deletions
18
plugins/site
18
plugins/site
|
@ -311,7 +311,25 @@ elif [[ "$type" == "-delete" && -a /etc/nginx/sites-available/$domain ]]; then
|
|||
elif [[ "$type" == "-ssl-on" && -a /etc/nginx/sites-available/$domain ]]; then
|
||||
isssl=$( grep -F "ssl on;" /etc/nginx/sites-available/$domain )
|
||||
[[ -z $isssl ]] && site_ssl_on || echo "${red}SSL is already enabled for site $domain!${end}"
|
||||
# SSL for WP-subdom subsites
|
||||
elif [[ "$type" == "-ssl-on" && ! -a /etc/nginx/sites-available/$domain && $subdomflag == 1 && $cache == "-root" && ! -d /var/www/$domain/htdocs && $tld == $value && -d /var/www/$tld/htdocs/wp-admin && -a /etc/nginx/sites-available/$value ]]; then
|
||||
if [[ -a /var/www/$value/wp-config.php ]]; then
|
||||
wpconfpath="/var/www/$value/wp-config.php"
|
||||
elif [[ -a /var/www/$value/htdocs/wp-config.php ]]; then
|
||||
wpconfpath="/var/www/$value/htdocs/wp-config.php"
|
||||
else
|
||||
echo "${red}[ERROR] wp-config.php file not found!${end}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wpsubdom=$( grep -F "'SUBDOMAIN_INSTALL'" $wpconfpath | cut -f 2 -d "," )
|
||||
if [[ $wpsubdom == *"true"* ]]; then
|
||||
echo "${blu}* SSL for WP Multisite with subdomain configuration.${end}"
|
||||
site_ssl_on
|
||||
else
|
||||
echo "${red}[ERROR] $value is not a WP Multisite with subdomain configuration.${end}"
|
||||
fi
|
||||
|
||||
|
||||
# SSL disabled (Letsencrypt)
|
||||
elif [[ "$type" == "-ssl-off" && -a /etc/nginx/sites-available/$domain ]]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue