http和https的区别是
有的网站,http打开的时候,页面提示不安全,比如你点击下面的网站 【其实是同一个网站】
http://www.511easy.com/bug/login
http://www.88bugs.com/bug/login
怎样才能去掉这个不安全的提示呢? 从http升级到https呗
最终效果看一下:
域名: 511easy.com
有域名了就可以申请免费的ssl证书,如下截图,基于各个Web服务器的证书,我这边用的是Nginx
那然后就需要配置nginx.conf的配置了,大概就是用下面的第三个,前两个是我用来保存的。
https和http相比,更加安全,不尽然,用jmeter/charles/wireshark/fiddle等,生成一个证书,对https的网站都能进行轻易的抓包,大多数的网站和app,我都能够进行抓包
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 |
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;
}
} |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 |
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;
}
}
} |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 |
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上的无状态连接,整个基本的工作流程是客户端发送一个https://www.kuaiidc.com/tag/http" title="HTTP">HTTP请求
https://www.kuaiidc.com/tag/http" title="HTTP">HTTPS —- Hyper Text Transfer Protocol over Secure Socket Layer 或 Hypertext Transfer Protocol Secure
全称是:超文本安全传输协议,可以简单理解为使用SSL加密传输的https://www.kuaiidc.com/tag/http" title="HTTP">HTTP协议
https://www.kuaiidc.com/tag/http" title="HTTP">HTTP的默认端口是80,https://www.kuaiidc.com/tag/http" title="HTTP">HTTPS的默认端口是443
SSL是为网络通信提供安全及数据完整性的一种安全协议。
为什么要使用https://www.kuaiidc.com/tag/http" title="HTTP">HTTPS
为了保护信息传输的安全性,数据完整性。让访客觉得网站可信任,对于国内的网络环境,也可以防止宽带运营商强制给网站挂广告。
如果希望一台服务器上,两个端口,分别用不用的域名执行不同的端口,Nginx可以这么配置
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 |
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/ 【目前修改后是指向另一个端口的项目了】
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对快网idc的支持。
原文链接:https://www.cnblogs.com/qianjinyan/p/10964545.html
相关文章
- ASP.NET自助建站系统的数据库备份与恢复操作指南 2025-06-10
- 个人网站服务器域名解析设置指南:从购买到绑定全流程 2025-06-10
- 个人网站搭建:如何挑选具有弹性扩展能力的服务器? 2025-06-10
- 个人服务器网站搭建:如何选择适合自己的建站程序或框架? 2025-06-10
- 64M VPS建站:能否支持高流量网站运行? 2025-06-10
- 2025-07-10 怎样使用阿里云的安全工具进行服务器漏洞扫描和修复?
- 2025-07-10 怎样使用命令行工具优化Linux云服务器的Ping性能?
- 2025-07-10 怎样使用Xshell连接华为云服务器,实现高效远程管理?
- 2025-07-10 怎样利用云服务器D盘搭建稳定、高效的网站托管环境?
- 2025-07-10 怎样使用阿里云的安全组功能来增强服务器防火墙的安全性?
快网idc优惠网
QQ交流群
-
2025-05-25 52
-
2025-06-04 88
-
2025-06-04 38
-
2025-05-27 99
-
2025-06-04 101






