nginx中ssl模块
来源:互联网 发布:mac帧ip类型数据长度 编辑:程序博客网 时间:2024/06/08 12:24
nginx的http的ssl模块
Module ngx_http_ssl_moduleTo reduce the processor load it is recommended to .set the number of worker processes equal to the number of processors, .enable keep-alive connections, .enable the shared session cache, .disable the built-in session cache, .and possibly increase the session lifetime (by default, 5 minutes)
Example
worker_processes auto;http {...server { listen 443 ssl; keepalive_timeout 70; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5; ssl_certificate /usr/local/nginx/conf/cert.pem; ssl_certificate_key /usr/local/nginx/conf/cert.key; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ...}
Example
一、生成证书# 1、首先,进入你想创建证书和私钥的目录,例如: cd /etc/nginx/# 2、创建服务器私钥,命令会让你输入一个口令:openssl genrsa -des3 -out server.key 1024# 3、创建签名请求的证书(CSR):openssl req -new -key server.key -out server.csr# 4、在加载SSL支持的Nginx并使用上述私钥时除去必须的口令:cp server.key server.key.orgopenssl rsa -in server.key.org -out server.key# 5、最后标记证书使用上述私钥和CSR:openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt二、配置http跳转 server { listen 443 ssl; ssl_certificate /etc/nginx/server.crt; ssl_certificate_key /etc/nginx/server.key; ssl_session_timeout 5m; location / { root html; } } server { listen 80; location ~ /services/.*$ { if ($server_port ~ "^80$"){ set $rule_0 1$rule_0; } if ($rule_0 = "1"){ rewrite /(.*) https://IP地址/$1 permanent; } } }浏览器当访问http://ip/test地址跳转到https://ip/test
参考:
http://blog.csdn.net/weixin_35884835/article/details/52588157
http://www.linuxidc.com/Linux/2013-05/84477p2.htm
阅读全文
0 0
- nginx中ssl模块
- nginx-ssl模块
- nginx 安装ssl模块
- Nginx安装ssl模块和nginx_lua模块
- nginx中配置SSL
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx 配置 ssl 模块支持 https
- nginx使用ssl模块配置HTTPS支持
- Nginx使用ssl模块配置https
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- nginx使用ssl模块配置HTTPS支持
- 1117. Eddington Number(25)
- R --xgboost使用
- SVN分支管理
- (14)cookie细节
- 浅析TCP通信原理
- nginx中ssl模块
- 笨办法19函数和变量
- quartz学习笔记6:多线程
- JavaWeb项目中数据库存入数据中乱码的解决方案
- c++基础之随机函数
- 用ImageLoader查找图片继承Application
- unigui导出EXCEL使用NATIVEEXCEL
- 花式读取Android CPU使用率
- 2017 ACM/ICPC Asia Regional Shenyang Online 1004 array array array