惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
The Cloudflare Blog
小众软件
小众软件
MyScale Blog
MyScale Blog
IT之家
IT之家
H
Help Net Security
宝玉的分享
宝玉的分享
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
博客园_首页
S
SegmentFault 最新的问题
MongoDB | Blog
MongoDB | Blog
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
Microsoft Security Blog
Microsoft Security Blog
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
P
Palo Alto Networks Blog
博客园 - 聂微东
罗磊的独立博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
U
Unit 42
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyberwarzone
Cyberwarzone
G
Google Developers Blog
C
Cybersecurity and Infrastructure Security Agency CISA
大猫的无限游戏
大猫的无限游戏
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
T
Tailwind CSS Blog
雷峰网
雷峰网
C
Cisco Blogs

博客园 - 懒牛拉车

xxx tmp Thinkphp 3.2 Cookie丢失导致中英文混排 第一个python自动化实例 Nginx配置文件下载 每次用npm都很烦人 js 判断mac地址是否为组播地址 项目在本地时,css/js文件在浏览器刷新时,从(memory cache)读取,放服务器上就不会 模拟json_decode解析非法utf-8编码字符串 php socket 循环ping ip,显示能ping通的IP地址 thinkphp3.2.2 CheckLangBehavior.class中,使用session无效原因分析 Thikphp 3.2 session页面传递失败问题 火狐autocomplete="off"无效 testlink windows 安装笔记 宝塔面板部署thinkcmf问题 coreseek 測試用例 coreseek 基与Sphinx 的全文索引 centos6 nginx安装好以后,添加拓展ssl centos6 php7 安装 memcache 和 memcached - 懒牛拉车 centos7 搭建 php7 + nginx (2) - 懒牛拉车 centos7 搭建 php7 + nginx (1)
centos6 nginx 配置本地https访问
懒牛拉车 · 2019-11-05 · via 博客园 - 懒牛拉车
  • 安装准备

yum install openssl openssl-devel
  • 生成文件

cd /usr/local/nginx/conf

# 生成密钥privkey.pem:
openssl genrsa -out privkey.pem 1024/2038

# 使用密钥生成证书server.pem:
openssl req -new -x509 -key privkey.pem -out server.pem -days 365

# 证书信息可以随便填或者留空,只有第一个填国家可以填写`CN`
  • 修改对应网站server内容

    listen       80;
    server_name  example.com;

    # 修改成如下

    listen       443;
    server_name  example.com;
    ssl                  on;
    ssl_certificate      server.pem;
    ssl_certificate_key  privkey.pem;
    ssl_session_timeout  5m;
    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;
  • 重启nginx即可

如果报错unknown directive "ssl" in /usr/local/nginx,那应该是nginx安装的时候,没有安装ssl_module,不需要重新安装nginx,方法请参考下面链接
https://www.cnblogs.com/qq917937712/p/11799524.html