nginx配置https
来源:互联网 发布:java 获取今年第一天 编辑:程序博客网 时间:2024/06/11 08:42
打铁趁热,上篇写了tomcat配置https,现在是nginx的。说实话,nginx配置https也不会,但是公司有需求,没办法,效率是低了点,被喷也是。。。无情啊。
官网文档:http://nginx.org/en/docs/http/configuring_https_servers.html
这个其实也是在网上找的,感谢各位网友提供的资料,但是确实是忘了保存原url了,求原谅。有问题请留言,一起讨论^_^
前提:
1.安装了openssl&&openssl-devel
yum -y install openssl openssl-devel
2.nginx加载了–with-http_ssl_module模块,如果没有加载可以重新编译加载
/opt/nginx/sbin/nginx -V #查看nginx的模块##如果没有则重新编译cd /home/download/nginx./configure --prefix=/opt/nginx --with-http_ssl_modulemake && make install
配置
生成证书
cd /opt/nginx/conf openssl genrsa -des3 -out server.key 1024 openssl req -new -key server.key -out server.csr cp server.key server.key.org openssl rsa -in server.key.org -out server.key openssl rsa -in server.key -out server.pem openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
修改nginx.conf,加载ssl证书
vim /opt/nginx/conf/nginx.confserver {listen 443 ssl;ssl on;ssl_certificate /opt/nginx/conf/server.crt;ssl_certificate_key /opt/nginx/conf/server.key;fastcgi_param HTTPS $https if_not_empty; #有https协议时自动使用https,否则忽略这个参数。ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;ssl_ciphers HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers on;}
0 0
- Nginx(12):nginx配置https
- nginx 配置https server
- nginx 配置https
- Nginx 配置 https 加密
- Nginx配置https服务器
- Ubuntu nginx 配置https
- nginx https配置
- nginx配置https
- nginx 配置https
- nginx 配置HTTPS服务器
- Linux nginx配置https
- nginx 配置https 环境
- Nginx配置Https
- nginx配置https
- Nginx配置https访问
- nginx配置https服务
- nginx配置https方法
- nginx配置https
- 调整坐标轴的刻度(locator_params)
- C#调用非托管代码(转)
- TCP/IP详解卷1笔记_第二章 链路层
- 牛顿迭代法
- Spring 、SpringMVC、Mybatis、MySQL、Maven、Tomcat搭建JavaWeb项目流程---学习笔记(一)工具准备及环境配置
- nginx配置https
- C#_DllImport用法和路径问题
- 欢迎使用CSDN-markdown编辑器
- java 从一个文件中读取内容 复制到 另一个文件中
- 从Instant run谈Android替换Application和动态加载机制
- mysql基本概念小结
- JsonPath 与Xpath对比学习
- Win32 SDK基础(3)—— 从零开始创建windows窗口(一)
- Linux 与 BSD 有什么不同?