Nginx全局/局部https访问配置方法
一、全局https访问
1.找到nginx安装目录、进入conf文件夹,打开nginx.conf文件;
2.在配置http访问的server中加入正则匹配代码:
rewrite ^(.*)$ https://$host$1 permanent;
二、指定目录使用https访问
1.以0537idc页面为例:
http://www.0536idc.com/main/ssl/showevpro.action
2.如果在指定的页面通过https访问。那么需要在server中加入以下代码:
location ~ ^/main/ssl/showevpro.html$ {
rewrite ^(.*)$ https://$host$1 permanent;
}
(本文为原创文章,未经允许禁止转载抄袭)