ngix+apache下https配置
来源:互联网 发布:mac 应用程序 身份不明 编辑:程序博客网 时间:2024/06/07 04:35
环境:wdcp+ngix+apache
ngix同时支持http和https:
1.下载证书,将证书文件放到 /www/wdlinux/nginx/conf目录下
2.修改ngix配置文件
/www/wdlinux/nginx/conf/vhost/www.xxxxxxx.com.conf
server {
listen 80;
listen 443 ssl;
root /网站目录;
server_name 域名;
index index.html index.php index.htm;
ssl_certificate zhengshu.crt;
ssl_certificate_key zhengshu.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
.
.
.
}
3.测试无误并重启web服务
/www/wdlinux/nginx/sbin/nginx -t
4.HTTPS服务器优化
cd /www/wdlinux/nginx/conf/
vi nginx.conf
参考:http://blog.csdn.net/mr_raptor/article/details/51854746
5.单页面中配置http自动跳转https方法
在需要强制为https的页面上加入该代码进行处理
<script type=”text/javascript”>
var url = window.location.href;
if (url.indexOf(“https”) < 0) {
url = url.replace(“http:”, “https:”);
window.location.replace(url);
}
</script>
参考:
http://www.cnblogs.com/phpper/p/6441475.html
https://cloud.tencent.com/document/product/400/4143
http://blog.csdn.net/weixin_35884835/article/details/52588157
http://blog.csdn.net/na_tion/article/details/17334669
http://www.cnblogs.com/wjoyxt/p/6102172.html
- ngix+apache下https配置
- Ubuntu下配置Apache HTTPS
- Centos下apache配置https
- Ubuntu下配置Apache HTTPS
- widows环境下配置NGIX+PHP服务器
- ngix配置
- ngix配置
- Ubuntu下APACHE HTTPS安装和配置
- linux下apache https 虚拟主机配置
- linux 下部署 openssl+apache 配置https
- MAC下配置Apache服务器支持https
- windows下为apache配置https
- Apache下配置https双向认证
- mac下Apache服务配置Https
- Apache下https服务的配置
- windows环境下 apache配置https协议
- Ubuntu下APACHE HTTPS安装和配置
- Ubuntu下APACHE HTTPS安装和配置
- 属性动画综合版
- Android Studio 常用配置
- Python3学习(25)--多继承之mix-in("混入")技术
- [Unity]AssetBundle资源更新以及多线程下载
- 摘自网络-是大措施保证网站的安全性
- ngix+apache下https配置
- Etherlab源码解析----分布时钟DC
- usb驱动开发之USB协议枚举过程详解
- 一个Unity打Bundle的代码[Lua+资源]
- android int与String的转换
- 欢迎使用CSDN-markdown编辑器
- VueJs制作轮播组件
- MMCheng图像显著算法RC配置
- 爬虫概念 请求方式 jsoup 分析思路 原理