Last update at :2024-06-21,Edit by888u
Although for ordinary personal websites, it has not been said that SSL domain name certificates must be used, but some user interaction and account security sites such as B2C still must use them, even if it is not for the purpose of the site. The experience requirements in search engines also require responsibility for user information. In previous blog posts, Snail has also shared several configurations of SSL domain name certificates in other commonly used environments.
LLsMP one-click package environment (Litespeed) deploys SSL security certificate and sets up HTTPS site
LAMP (Apache) environment deployment and installation of SSL security certificates and HTTPS encrypted websites
The process of installing SSL security certificate and deploying HTTPS website URL in LNMP one-click package environment
Snail has previously shared an article simply configuring SSL for commonly used Apache, Nginx, and LiteSpeed environments. This article is based on configuring SSL in the AMH panel environment. Last week, some netizens raised the need to solve this problem. Due to time issues, it was only published today (most of the time the tutorials are very troublesome. For authenticity, you must do it yourself. To apply for a certificate, you also need to deploy the environment).
First, preparations
Before we need to configure the domain name site SSL certificate for the AMH panel, we need to prepare a few points:
A – AMH panel has been built and the site has been bound
B - For the SSL certificate that has been applied for, prepare the "for Nginx" certificate files, one is .crt and the other is .key file.
C – Certification is required to read the article and follow the steps.
Second, deploy the SSL extension module
Log in to the AMH panel backend, search for SSL in the module extension area, find the SSL module shown in the picture above, and then download it.
Return to the module list and install the SSL module extension you just downloaded.
Third, deploy the SSL certificate file
Then we deploy the SSL certificate, open the .KEY and .CRT files we prepared for the preparation work, use SUBLIME, then copy the script inside, paste it into the corresponding text box and save it. (If there are multiple sites in AMH, check whether you have selected the site where you need to deploy SSL)
Fourth, force redirect to HTTPS URL
So far, if we have deployed the domain name, we can directly open the URL with the SSL certificate through HTTPS. But what if we need to force a jump to HTTPS?
/usr/local/nginx/conf/vhost/
In the directory above, find the .conf file corresponding to the site, and then edit it.
if ($server_port = 80) {return 301 https://$server_name$request_uri;}if ($scheme = http) {return 301 https://$server_name$request_uri;}error_page 497 https://$ server_name$request_uri;
Add the above script to the document, as shown below.
After the deployment and replacement is completed, execute amh nginx restart to restart nginx and it will take effect.
In summary, it is relatively simple to deploy SSL domain name certificates on the AMH panel. It does not require too many modifications and configuration files. It can be completed directly by adding it in the module extension.
Recommended site searches: US free hosting, virtual hosting, US independent hosting, Hong Kong server defense, which Hong Kong space is better to buy server high defense, US hosting reviews, server rental, Hong Kong virtual hosting space, how to rent a server,
发表评论