效果:

nginx添加ssl模块

./configure  --with-http_ssl_module

生成证书

openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 1096 -key ca.key -out ca.crt

配置文件

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65; server {
listen 80;
server_name localhost; location / {
root html;
index index.html index.htm;
return 301 https://$server_name$request_uri;
} } # HTTPS server server {
listen 443 ssl;
server_name localhost; ssl_certificate ca/ca.crt;
ssl_certificate_key ca/ca.key; ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; location / {
root html;
index index.html index.htm;
}
} }

启动

./sbin/nginx -c conf/ca.conf

nginx使用https协议的更多相关文章

  1. 【转】Linux下nginx配置https协议访问的方法

    一.配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/ ...

  2. Linux下nginx配置https协议访问

    一.配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/ ...

  3. Linux下nginx配置https协议访问的方法

    一.配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/ ...

  4. nginx 采用https 协议通信配置

    在网络通信中,使用抓包软件可以对网络请求进行分析,并进行重放攻击,重放攻击的解决方案一般是使用一个变化的参数,例如RSA加密的时间戳,但考虑到网络传输时延,时间戳需要有一定的误差容限,这样仍然不能从根 ...

  5. nginx 使用HTTPS协议-SSL证书模块报错解决-附nginx安装 : [emerg] the "ssl" parameter requires ngx_http_ssl_module in nginx.c

    Linux系统下ngnix使用HTTPS协议启动报错: nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_modul ...

  6. 阿里云服务器Centos7上使用Nginx部署https协议的网站

    1,申请域名证书成功后,下载压缩包,一定要选择Nginx的证书类型,解压后得到一个key文件一个pem文件,将这两个文件上传到服务器的root目录 2,打开nginx配置文件 vim /etc/ngi ...

  7. Centos下nginx支持https协议

    1.首先配置nginx及其他插件,这个Google下,很多配置方案. 2.配置服务器的证书.操作步骤如下: [root@localhost ~]# cd /etc/pki/tls/certs [roo ...

  8. Linux服务之nginx服务篇四(配置https协议访问)

    一.配置nginx支持https协议访问 编译安装nginx的时候需要添加相应的模块--with-http_ssl_module和--with-http_gzip_static_module(可通过/ ...

  9. CentOS6.5 下在Nginx中添加SSL证书以支持HTTPS协议访问

    参考文献: 1. NginxV1.8.0安装与配置 2. CentOS下在Nginx中添加SSL证书以支持HTTPS协议访问 3. nginx配置ssl证书的方法 4.nginx强制使用https访问 ...

随机推荐

  1. 2017-12-18python全栈9期第三天第二节之str常用操作方法及for循环之判断字母数字组成

    #!/user/bin/python# -*- coding:utf-8 -*-name = 'zd123'print(name.isalnum()) #由数字或字母组成print(name.isal ...

  2. 信用评分卡 (part 2of 7)

    python信用评分卡(附代码,博主录制) https://study.163.com/course/introduction.htm?courseId=1005214003&utm_camp ...

  3. Zabbix Server 监控Web页面

    Zabbix Server 监控Web页面 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.  1>.选中一台可以连接互联网的主机 2>.创建一个web场景,点击“Crea ...

  4. SQL语法基础之DELETE语句

    SQL语法基础之DELETE语句 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看帮助信息 1>.查看DELETE的帮助信息 mysql> ? DELETE Na ...

  5. nGrinder TestRunner http post json

    s nGrinder学习笔记 — post请求 https://blog.csdn.net/meyoung01/article/details/50435881 import HTTPClient.H ...

  6. 解决gitk显示文件内容中文乱码

    解决gitk显示文件内容中文乱码 1.git config 命令 设置git gui的界面编码 git config --global gui.encoding utf-8 2.修改配置文件 在~\e ...

  7. Program License Agreement updated/The updated Apple Developer Program License Agreement needs to be reviewed.

    Apple APP添加新APP时提示The updated Apple Developer Program License Agreement needs to be reviewed. 解决办法 登 ...

  8. mysql使用navicat和mysqldump导出数据

    1.navicat 方式一:选中表,右键转储:(含有表结构和数据) 方式二:选择右上角工具,点击数据传输,在这个页面右侧选择数据库,左侧选择文件. 点击下一步,选择导出的表名和各种函数什么的,然后点击 ...

  9. 使用JMeter进行一次简单的带json数据的post请求测试,json可配置参数

    配置: 1.新建一个线程组: 然后设置线程数.运行时间.重复次数. 2.新建Http请求: 设置服务器域名,路径,方法,编码格式,数据内容. 可以在函数助手中,编辑所需要的变量,比如本例中的随机生成电 ...

  10. Python线程和协程-day10

    写在前面 上课第10天,打卡: 感谢Egon老师细致入微的讲解,的确有学到东西! 一.线程 1.关于线程的补充 线程:就是一条流水线的执行过程,一条流水线必须属于一个车间: 那这个车间的运行过程就是一 ...