In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to configure SSL certificates for domain names in Nginx. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
Concrete process
Start access
(1) below I use my own website, configure my personal website SSL certificate, and upgrade my website to SSL.
(2) then we changed it to https and found that it was impossible to access it.
Let's officially start by changing the website to the request for access by https.
Server installs Nginx
First of all, we need to install the Nginx environment on the server. If your server already has Nginx, you can skip this step. If Nginx is not installed, please refer to
Get the SSL certificate
Since my server is bought by Aliyun, Ali will send several free SSL certificates. The following is explained by the process of obtaining SSL certificates of Aliyun.
If you are not an Aliyun customer, you can skip this step and then buy Baidu's "SSL certificate" to the relevant manufacturer, or Baidu's "free SSL certificate".
(1) Log in to Aliyun, then find the [SSL Certificate] column, and click (because I have already passed this function, your location may be different from mine, go to the panel to find it yourself).
(2) when you come to this panel, click "purchase Certificate".
(3) choose the free type, and then purchase
(4) when you have completed the purchase, a corresponding record will appear on the page, and then click "Certificate Application".
(5) then write the domain name you need to upgrade. For example, I want to upgrade my personal website http://www.zyqok.cn to https://www.zyqok.cn.
Then enter zyqok.cn for the domain name at this time, then fill in other information, click next, and then the certificate will be submitted to the above for approval.
(6) when your application is approved, you can download your SSL certificate. Click [download] in the lower right corner.
(7) continue to select * * download * * after Nginx
(8) after downloading, we can get a compressed package of SSL certificate.
Upload a SSL certificate to the server
(1) We first decompress the certificate package, and then we can get the following two files.
(2) We upload these two files to the server through the FTP tool and put them in the same directory where the Nginx configuration file is located.
Modify the configuration and restart
(1) Open your Nginx.conf configuration file, and configure your server information on ports 443 and 80 as follows:
For more detailed steps, you can see Aliyun's documentation: Nginx/Tengine server installs SSL certificate
# directly visit https server {charset utf8; listen 443; root / opt/local; server_name www.zyqok.cn; ssl on; ssl_certificate 3067072 roomzyqok.cn.pem.ssl_certificate_key 3067072roomzyqok.cn.key; ssl_session_timeout 5m Ssl_ciphers ECDHEluRSAMELAES128MUGCMMuSHA256 Velcro ECDHEVECDHVIEHVIEHHGHV / Null / ANULLRC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on;} # http jumps to https server {listen 80; server_name zyqok.cn; rewrite ^ / (. *) https://www.zyqok.cn permanent;}
(2) Note that the blue box contains documents related to your domain name and SSL certificate.
(3) then restart your Nginx service
Restart the nginx service by entering the following command in the sbin directory of nginx
. / nginx-s reload
(4) if it is Aliyun's server, don't forget to open ports 80 and 443, otherwise you won't be able to access it.
For those that will not be configured, please refer to this article: Ali Cloud Security Rule configuration
The above is how to configure SSL certificates for domain names in Nginx. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.