Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Docker to build local https environment

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use Docker to build a local https environment. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

What is https?

We all know that the operation of web app is based on the network application layer http protocol, and the http protocol can make requests and returns between the client and the server. However, this process is transmitted in clear text, and the content of the transmission is easy to be tampered with when the request is caught, which is an extremely serious threat to the security of users. For security reasons, pwa applications require that the project must be deployed in a https environment.

So what is https?

Https places http on top of ssl/tls, and its effect is to encrypt http traffic (traffic), including requested url, result pages, cookies, media resources, and other content transmitted through http. People who attempt to interfere with https connections can neither monitor traffic nor change its contents. In addition to encryption, the identity of the remote server also needs to be verified: after all, encrypted connections don't make any sense if you can't determine who the other end of the connection is. These measures will make it extremely difficult to block traffic. Although it is still possible for an attacker to know which site the user is visiting, that's all he can know.

Https request flowchart

In this article, we will use docker & docker-compose to build a local https environment. Let's take a look at the detailed introduction.

Tools:

Acme#sh (generate free certificate)

Docker & docker-compose

Ihost (you can modify the hosts file manually)

Configuration file:

Docker-compose.dev.yml

?

1 2 3 4 "start egg.jsyarn dev # start nginxdocker-compose-f docker-compose.dev.yml up

Open the chrome and you can see the green lock next to it. It's done.

This is the end of the article on "how to use Docker to build a local https environment". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Original link: https://zhuanlan.zhihu.com/p/36201147

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report