Nginx多域名多证书多站点配置最佳实践
在nginx.conf下http块中增加include conf.d/*.conf如下。
/usr/locol/nginx/conf/nginx.conf123http { include conf.d/*.conf;}
以www.example.com为例,在conf.d文件夹下创建www.example.com.conf文件,根据需要增加如下配置块。
/usr/locol/nginx/conf/conf.d/www.example.com.conf12345server { listen 80; server_name example.com www.example.com; return 302 https://$host$request_uri;}
/usr/locol/nginx/conf/conf.d/www.example.com.conf123456789101112131415161718192021222324server { listen 443 ssl; ...