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
Table of contents 1. Configure bridging and captu...
Table of contents question Server layer and stora...
Table of contents Install CentOS7 Configuring Sta...
1. Install Docker 1. I installed Centos7 in the v...
1. Download the alpine image [root@docker43 ~]# d...
XML/HTML CodeCopy content to clipboard < div s...
Some usage of float Left suspension: float:left; ...
You need to apply CSS to div or span at the same t...
Table of contents 1. Pull the centos image 2. Bui...
This article shares the specific code of js to im...
Table of contents 1. Component switching method M...
Table of contents Preface Optional Chaining Nulli...
Table of contents 1. Introduction 2. MVCC (Multi-...
Let’s take a look first. HTML source code: XML/HT...
Vue router transitions are a quick and easy way t...