Tencent Cloud's [Guide] (https://cloud.tencent.com/document/product/400/35244?from=10680) is based on CentOs and does not apply to Ubuntu systems.
The following is a correction to the part of the above guidance article that does not apply to Ubuntu.
nginx configuration folder: /etc/nginx/
nginx executable file: /usr/sbin/nginx
Add https site: modify /etc/nginx/sites-enabled/* *site configuration file
Modified content:
server {
listen 443;
server_name www.domain.com; #Fill in the domain name of the binding certificate
ssl on;
root /var/www/www.domain.com; #The homepage path of the website. This path is for reference only, please follow the actual directory for details.
index index.html index.htm;
ssl_certificate /usr/local/nginx/conf/1_www.domain.com_bundle.crt; #Certificate file path+name
ssl_certificate_key /usr/local/nginx/conf/2_www.domain.com.key; #Private key file path+name
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
index index.html index.htm;}}
server {
listen 80;
server_name www.domain.com; #Fill in the domain name of the binding certificate
rewrite ^(.*)$ https://$host$1 permanent; #Convert http domain name request to https
}
Recommended Posts