I have a Nginx configured to serve a Wordpress subdomain multisite with main domain as domain.com.
We use it to create several sites to our customers, then some of them want a personalized url, in our site we have customername.domain.com
and configure Wordpress site to have customerdomain.com
to serve the customer site without using our subdomain.
My Nginx looks like:
map $http_host $blogid {
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
}
server {
server_name domain.com *.domain.com ;
root /var/www/html/portal;
index index.php;
access_log /var/log/nginx/nginxwp.access.log combined;
error_log /var/log/nginx/nginxwp.error.log;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$args ;
}
#WPMU Files
location ~ \.php$ {
autoindex on;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
client_max_body_size 100M;
proxy_connect_timeout 180;
proxy_send_timeout 180;
proxy_read_timeout 180;
}
location ~ ^/files/(.*)$ {
try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ;
access_log off; log_not_found off; expires max;
}
}
Until here, everything works fine.
Now I need to secure my customer domain.
How can I serve my customer site under ssl certificate to the domain customerdomain.com and keep others sites under HTTP
and even our main site domain.com
untouched ?