I have been studying how to get https. Recently I saw the free SSL certificate provided by Tencent Cloud, and I was thinking about making the website https. First, go to Tencent Cloud to purchase a free certificate. Click to fill in the content. Then download the certificate Unzip the certificate and you can see that there are four ways to modify https. The one we need is Contents of the Nginx package. The certificate is finished here. Then let me talk about the project configuration. My website project is made with springboot, and the port number is 8888. Then install nginx on the server. I won’t go into details about the installation. If you don’t understand, just search on Baidu. It’s very simple. All that needs to be said is the nginx.conf configuration: ##Here is to redirect the default http port 80 to https server { listen 80; server_name www.dalaoyang.cn; rewrite ^ https://$http_host$request_uri? permanent; } ##Here is to intercept the default request to https port 443## and forward the request to http://127.0.0.1:8888/ server { listen 443; server_name www.dalaoyang.cn; ssl on; ssl_certificate 1_dalaoyang.cn_bundle.crt; ssl_certificate_key 2_dalaoyang.cn.key; ssl_session_timeout 5m; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; #Your project port number proxy_pass http://127.0.0.1:8888/; proxy_redirect off; } } Then enter www.dalaoyang.cn on the website and you can see the following picture The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to get the width and height of the image in WeChat applet
>>: mysql5.5 installation graphic tutorial under win7
I won't go into details about how important b...
When it comes to tool-type websites, we first hav...
1. Always use :key in v-for Using the key attribu...
Table of contents Preface Generate SVG Introducti...
When the jsp that is jumped to after the struts2 a...
describe: Install VM under Windows 10, run Docker...
Drawing EffectsImplementation Code JavaScript var...
1. this.$router.push() 1. Vue <template> &l...
This article example shares the specific code for...
First, let's introduce several common operati...
During this period of time, I was studying docker...
1. Docker network management 1. Docker container ...
What is WSL Quoting a passage from Baidu Encyclop...
What are the lifecycle functions of React compone...
Table of contents 1. Why Redux 2. Redux Data flow...