First, to go to Tencent Cloud application
Once the application is successful, you will be able to download the certificate directly.
Second, configure Nginx
In the /etc/nginx/conf.d/
next add your domain name configuration such as xxx.com.conf, content as follows
server {
listen;
Listen 443 SSL;
server_name www.xxx.com;
SSL_CERTIFICATE/ETC/NGINX/SSL/WWW.XXX.COM_CERT.CRT;
Ssl_certificate_key/etc/nginx/ssl/www.xxx.com.key;
Location/{
proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_set_header Host $http _host;
Proxy_set_header X-forwarded-proto $scheme;
Proxy_pass http://127.0.0.1:8360
}
}
proxy_pass
That is, the reverse proxy to the address of your node service.
sslcertificate
And the sslcertificate_key
need to specify the certificate directory file, that is, the file you downloaded to the /etc/nginx/ssl
directory to copy the.
Third, the last restart Nginx can be slightly. Very simple.
Note Switch to HTTPS The trouble is coming, HTTPS does not allow HTTP resource loading requests, so it is a good idea to replace those addresses with support for HTTPS.
Summarize
The above is the entire content of this article, I hope the content of this article for everyone to learn or use Node.js can help, if you have questions you can message exchange.