Nginx http升级到https
http和https的区别是
有的网站,http打开的时候,页面提示不安全,比如你点击下面的网站 【其实是同一个网站】
http://www.511easy.com/bug/login
http://www.88bugs.com/bug/login


怎样才能去掉这个不安全的提示呢? 从http升级到https呗
最终效果看一下:


如果目前有一个网站,要怎么升级为https呢
域名: 511easy.com
有域名了就可以申请免费的ssl证书,如下截图,基于各个Web服务器的证书,我这边用的是Nginx

那然后就需要配置nginx.conf的配置了,大概就是用下面的第三个,前两个是我用来保存的。
https和http相比,更加安全,不尽然,用jmeter/charles/wireshark/fiddle等,生成一个证书,对https的网站都能进行轻易的抓包,大多数的网站和app,我都能够进行抓包
upstream tomcatserver1 {
server 127.0.0.1:8083;
}
upstream tomcatserver2 {
server 127.0.0.1:8085;
}
server {
listen 80;
server_name 511easy.com;
location / {
proxy_pass http://tomcatserver1;
index index.html index.htm;
}
}
server {
listen 80;
server_name 511easy.com;
location / {
proxy_pass http://tomcatserver2;
index index.html index.htm;
}
}
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name 88bugs;
location / {
proxy_pass http://localhost:8083;
}
}
server {
listen 80;
server_name jenkins;
location / {
proxy_pass http://localhost:8080;
}
}
}
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 443 ssl;
server_name www.511easy.com;
ssl on;
ssl_certificate 1_511easy.com_bundle.crt;
ssl_certificate_key 2_511easy.com.key;
ssl_session_timeout 5m;
location / {
proxy_pass http://localhost:8083;
}
}
}
巩固一下这几个缩写名词的含义
HTTP --- Hyper Text Transfer Protocol,超文本传输协议,是一种建立在TCP上的无状态连接,整个基本的工作流程是客户端发送一个HTTP请求
HTTPS ---- Hyper Text Transfer Protocol over Secure Socket Layer 或 Hypertext Transfer Protocol Secure
全称是:超文本安全传输协议,可以简单理解为使用SSL加密传输的HTTP协议
HTTP的默认端口是80,HTTPS的默认端口是443
SSL是为网络通信提供安全及数据完整性的一种安全协议。
为什么要使用HTTPS
为了保护信息传输的安全性,数据完整性。让访客觉得网站可信任,对于国内的网络环境,也可以防止宽带运营商强制给网站挂广告。
如果希望一台服务器上,两个端口,分别用不用的域名执行不同的端口,Nginx可以这么配置
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 443 ssl;
server_name www.88bugs.com;
ssl_certificate 1_88bugs.com_bundle.crt;
ssl_certificate_key 2_88bugs.com.key;
ssl_session_timeout 5m;
location / {
proxy_pass http://localhost:8083;
}
}
server {
listen 443 ssl;
server_name www.511easy.com;
ssl_certificate 1_511easy.com_bundle.crt;
ssl_certificate_key 2_511easy.com.key;
ssl_session_timeout 5m;
location / {
proxy_pass http://localhost:8085;
}
}
}
https://www.88bugs.com/bug/login
https://www.511easy.com/ 【目前修改后是指向另一个端口的项目了】
Nginx http升级到https的更多相关文章
- 让你的网站免费支持 HTTPS 及 Nginx 平滑升级
为什么要使用 HTTPS ? 首先来说一下 HTTP 与 HTTPS 协议的区别吧,他们的根本区别就是 HTTPS 在 HTTP 协议的基础上加入了 SSL 层,在传输层对网络连接进行加密.简单点说在 ...
- 阿里云免费购买SSL证书,nginx无缝升级https
最近在升级交流学习社区,觉得有必要升级成https.以下是自己在升级中记录. 以下包括以下部分: 一.阿里云免费购买SSL证书 1.自己在阿里云申请了免费的,然后自己支付0元,购买了SSL证书 2.我 ...
- nginx将http升级到https并且同时支持http和https两种请求、http自动转向https
1.http升级到https 1.1.检查 Nginx 是否支持 SSL /usr/local/nginx/sbin/nginx -V configure arguments中是否有--with-ht ...
- 【Nginx】将http升级到https并且同时支持http和https两种请求
一.如何将http升级到https 需要满足下面三个: 1.域名 2.nginx 3.SSL证书 一般第三方证书颁发机构下发的证书是收费的,一年好几千. 1) 从腾讯云申请免费的SSL证 ...
- 从 http 升级到 https 过程中遇到的一些问题
Apple 2017年1月1号起要求Appstore 上线的应用都必须使用 https 加密请求协议,在二月份又改为建议 从 http 升级为 https 协议,此为背景. 公司做的APP同时在App ...
- 网站通信协议升级到HTTPS&HTTP2
为何要升级到HTTPS和HTTP2? http://baijiahao.baidu.com/s?id=1602041305989767011&wfr=spider&for=pc htt ...
- Nginx range filter模块数字错误漏洞修复 (Nginx平滑升级) 【转】
对线上生产环境服务器进行漏洞扫描, 发现有两台前置机器存在Nginx range filter模块数字错误漏洞, 当使用nginx标准模块时,攻击者可以通过发送包含恶意构造range域的header ...
- nodejs从http升级到https(阿里云证书的使用)
升级原因 1.各大搜索引擎中,https的网页的权重比一般的http的网页权重要高. 2.从用户体验的角度,一个老是被浏览器提醒该网页不可信的网页,总不会让用户感到安心 所以将网站从http升级为ht ...
- nginx安装升级及配置详解
1.简介 2.安装配置 3.配置文件介绍 4.启动.停止.平滑重启.升级 一.Nginx简介 Nginx(engine x)是俄罗斯人Igor Sysoev编写的一款高性能的http和反向代理服务器. ...
随机推荐
- bootstrap模态框怎么传递参数
bootstrap参数传递可以用 data-参数名 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml&qu ...
- [转帖]六种Socket I/O模型幽默讲解
六种Socket I/O模型幽默讲解 https://www.cnblogs.com/jikebiancheng/p/6225009.html 原贴已经找不到了.. 老陈有一个在外地工作的女儿,不能经 ...
- [转帖]上云测试,这些关键点你get 到没有
上云测试,这些关键点你get 到没有 https://www.cnblogs.com/mypm/p/10852656.html?tdsourcetag=s_pcqq_aiomsg sticky 还有s ...
- 利用Anaconda软件安装opencv模块
先说明我安装opencv环境的原因:因为我Anaconda中创建了tensorflow和pytorch虚拟环境,想在每个虚拟环境下都安装opencv模块,这样在后期进行代码调试的时候更加便捷,以下是我 ...
- 剑指offer48:不用加减乘除做加法
1 题目描述 写一个函数,求两个整数之和,要求在函数体内不得使用+.-.*./四则运算符号. 2 思路和方法 位运算符:两个数异或(^)[1^0=1, 1^1=0, 0^0=0, 0^1=1, 5^5 ...
- Python-03-流程控制
一.if判断语句 1. if...else if 条件: 满足条件时要做的事情1 满足条件时要做的事情2 ...... else: 不满足条件时要做的事情1 不满足条件时要做的事情2 ...... # ...
- Redis--hash类型操作命令
哈希类型hash redis hash 是一个 string 类型的 field 和 value 的映射表,hash 特别适合用于存储对象 哈希类型hash——基本命令 hset /hget /hms ...
- echarts饼状图位置设置
series: { name: "流量占比分布", type: "pie", radius: ["40%", "60%" ...
- PB笔记之取项次最大值(即使用.describe(" evaluate('ITM_max',0) ") 获取列的最大值) 的条件
dw_1.describe(" evaluate('ITM_max',0) ") :使用 describe 配合 evaluate 取列的最大最小值(或其它表达式)时,必须在数据 ...
- U盘安装Ubuntu14.04&配置远程win10远程连接
1.U盘安装Ubuntu:https://blog.csdn.net/baigoocn/article/details/26561473 2.win10远程访问Ubuntu系统:https://www ...