ecstore之服务器配置开启https小程序套壳
ecstore之服务器配置开启https,小程序中套壳
可以上阿里和腾讯申请免费的ssl证书。证书对应选择您的系统环境 apache nginx
记得服务器要开放443端口
上传证书到服务器。
nginx配置https
-----------------------------------------------------------------------------------------------
nginx.conf中添加如下配置:
server {
listen 443;
server_name 你的网站域名;
ssl on;
root 网站运行目录;
index index.php index.html index.htm;
ssl_certificate 证书存放位置;
ssl_certificate_key 证书存放位置;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 1h;
}
access_log /home/wwwlogs/nginx****.com.log main;
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
重启下nginx 或者重新加载下nginx配置文件
先找到文件,app/site/controller/admin/module.php 中的第35-37行把注释打开。
后台则在站点-》系统模块列表页中可以看到开启和关闭SSL
开启ssl后,前台访问网站,如果显示黄色标示,说明这个页面下还有一些链接是非https的。需要把http的链接修改成https
如有任何疑问都可以直接联系QQ:2392521892来解答。
