网站升级https后,nginx也配置好了,二级域名能强制到https,主域名也能,唯独带有www的域名不可以
listen 80;
server_name jxcat.com www.jxcat.com ~^(?<subdomain>.+)jxcat\.com$;
rewrite ^/(.*)$ https://${subdomain}jxcat.com/$1 permanent;
listen 443;
ssl on;
server_name jxcat.com www.jxcat.com ~^(?<subdomain>.+)jxcat\.com$;
使用jxcat.com,bbs.jxcat.com都能强制跳转到https,就www.jxcat.com不行
经过排查发现问题居然出在阿里云的web应用防火墙上, 我们购买了阿里云的应用防火墙,并勾选了https,
本以为就可以了,结果后面还有一个高级设置
开启https强制跳转默认是关闭的,需要开启,开启后就可以强制跳转到https了