Onex ecstore使nginx负载均衡支持https

响应政府号召,最近越来越多的客户需要网站支持https了,特写下教程方便大家

使ecstore支持https相关文章可查看

https://jinjiajin.cn/1582.html
https://jinjiajin.cn/1475.html

在做nginx自带分发支持https时遇到一些问题,我们直接来看下解决方案:

1.申请https证书

一般推荐阿里云,腾讯云,七牛云 免费证书

2.在lb.conf中server增加如下信息


listen 443;
ssl on;
ssl_certificate
//为你申请到的key
/usr/local/nginx/conf/ssl_tengxun/ecstore.acgcss.com/1_ecstore.acgcss.com_bundle.crt;
ssl_certificate_key
//为你申请到的key
/usr/local/nginx/conf/ssl_tengxun/ecstore.acgcss.com/2_ecstore.acgcss.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

3.被分发的ec.conf中增加新的规则,然后重启nginx即可

fastcgi_param HTTPS on;