前提条件:
先创建好站点
1. 登录WDCP 后台 , 打开 “系统管理” , “文件管理”
2. 前端使用 “nginx” , 就选择nginx。 新建站点后,这里都会生成一个用域名命名的配置文件。
将配置文件复制一份,保存为 “ssl.conf” 。 名字可以自己定义。
3. 修改ssl.conf配置文件 (修改端口和添加SSL配置,红色标记部分, 证书自己上传到/www/ssl目录。)
apache方式也一样,请参考Apache配置教程。
server{listen443;server_namewww.; root/www/web/domain/public_html; indexindex.htmlindex.phpindex.htm;sslon;ssl_certificate/www/ssl/server.crt;ssl_certificate_key/www/ssl/server.key;ssl_protocolsTLSv1.2TLSv1.1TLSv1;ssl_prefer_server_cipherson;error_page400/errpage/400.html; error_page403/errpage/403.html; error_page404/errpage/404.html; location~.php${ proxy_passhttp://127.0.0.1:88; includenaproxy.conf; } location/{ try_files$uri@apache; } location@apache{ proxy_passhttp://127.0.0.1:88; includenaproxy.conf; } }
4. 重启web服务 (系统管理 —> 服务重启)
5. 安全管理 –> 防火墙(iptables) .
如果启用了防火墙,添加443端口允许访问。
猜你喜欢