nginx 添加https支持
自行颁发不受浏览器信任的SSL证书
为晒晒IQ网颁发证书。ssh登陆到服务器上,终端输入以下命令,使用openssl生成RSA密钥及证书。
# 生成一个RSA密钥
$ openssl genrsa -des3 -out ssl.key 1024 # 生成一个证书请求
$ openssl req -new -key ssl.key -out ssl.csr # 自己签发证书
$ openssl x509 -req -days 365 -in ssl.csr -signkey ssl.key -out ssl.crt
第3个命令是生成证书请求,会提示输入省份、城市、域名信息等,重要的是,email一定要是你的域名后缀的。这样就有一个 csr 文件了,提交给 ssl 提供商的时候就是这个 csr 文件。当然我这里并没有向证书提供商申请,而是在第4步自己签发了证书。
编辑配置文件nginx.conf,给站点加上HTTPS协议
server {
server_name YOUR_DOMAINNAME_HERE;
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/33iq.crt;
ssl_certificate_key /usr/local/nginx/conf/33iq_nopass.key;
# 若ssl_certificate_key使用33iq.key,则每次启动Nginx服务器都要求输入key的密码。
}
nginx 添加https支持的更多相关文章
- 转自《https安全链接的配置教程:startSSl免费证书申请与nginx的https支持配置》
一.什么是 SSL 证书,什么是 HTTPS 网站? SSL证书是数字证书的一种,类似于驾驶证.护照和营业执照的电子副本.SSL证书通过在客户端浏览器和Web服务器之间建立一条SSL安全通道(Secu ...
- 使用Spring Boot开发Web项目(二)之添加HTTPS支持
上篇博客使用Spring Boot开发Web项目我们简单介绍了使用如何使用Spring Boot创建一个使用了Thymeleaf模板引擎的Web项目,当然这还远远不够.今天我们再来看看如何给我们的We ...
- Nginx server之Nginx添加ssl支持
//环境介绍 1.nginx服务器:10.10.54.157 2.配置nginx服务器,当监听到来自客户端www.zijian.com:80请求时,转到10.10.54.150:1500这个web服务 ...
- Let's Encrypt: 为CentOS/RHEL 7下的nginx安装https支持-具体案例
环境说明: centos 7 nginx 1.10.2 前期准备 软件安装 yum install -y epel-release yum install -y certbot 创建目录及链接 方法1 ...
- Nginx 添加 PHP 支持
背景介绍默认安装的Nginx是无法打开php文件的,需要修改相关配置才能支持php 安装yum -y install epel-release yum -y install nginx yum ins ...
- nginx 添加https 配置
#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log notice;#error_l ...
- ubuntu下apache添加https支持
http是无状态,不安全的连接.而https是通过ssl加密的http连接,可靠性更强. 确保openssl安装完成,用openssl来产生和签署证书,可以自己签署,但是不安全,建议用证书机构颁发的证 ...
- charles添加https支持
- 为 docker 中的 nginx 配置 https
没有 https 加持的网站会逐渐地被浏览器标记为不安全的,所以为网站添加 https 已经变得刻不容缓.对于商业网站来说,花钱购买 SSL/TLS 证书并不是什么问题.但对于个人用户来说,如果能有免 ...
随机推荐
- POJ3126Prime Path(BFS)
#include"cstdio" #include"queue" #include"cstring" using namespace std ...
- redis的 key string hash list set sorted set 常用的方法
redis 安装文件: http://blog.csdn.net/tangsilai/article/details/7477961 ============================== ...
- Arcane Numbers 1
Vance and Shackler like playing games. One day, they are playing a game called "arcane numbers& ...
- Flask13 面试要能吹 、安装虚拟机、虚拟机全局设置、导入虚拟机文件、虚拟机局部设置
1 web开发工作的三个能力 1.1 开发思想 易维护:开发成本远低于维护成本 可扩展:随着访问量的增加会自动使用多个数据库 高可用:程序就像小强一样,开发的系统能够经得住狂风暴雨的吹残(例如:一台主 ...
- 9、IPA通路分析相关网页教程
IPA FAQ: http://ingenuity.force.com/ipa/IPATutorials# ####有各种相关教程和帮助文件. IPA 分析结果展示: http://www.lucid ...
- Ubuntu12.04 上使用perl snmpwalk问题
今天在Ubuntu12.04上使用perl来获取snmp数据,运行时出现下列问题.解决方法安装一下libnet-snmp-perl即可.命令行运行:sudo apt-get install libne ...
- Win7常用但是被忽略的快捷键
General keyboard shortcuts 1.Ctrl + Right Arrow Move the cursor to the beginning of the next word 向 ...
- C# 写 LeetCode Medium #2 Add Two Numbers
2. Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. ...
- vue -- 正确的引入jquery
虽然vue中尽量不要使用jquery,但有时因为业务需求也不得不引入. 下载依赖 npm i jquery --save 全局配置的方法: 在webpack.base.conf.js里加入: var ...
- Educational Codeforces Round 52F(树形DP,VECTOR)
#include<bits/stdc++.h>using namespace std;int n,k;vector<int>son[1000007];int dp[100000 ...