问题
I am running a Ubuntu 18.04 server on AWS Lightsail, using nginx. I have a purchased SSL certificate for my domain name through the domain registrar (domain.com) - I can download the 'certificate' and the 'key' as long strings of text characters/symbols. How do I then 'install' this SSL certificate onto my Nginx server?
回答1:
There are two files that must be configured on the Nginx server, the certificate .crt
and the certificate key .key
, you simply have to have these 2 files on your Nginx server.
And using a server
block which are Nginx configuration files, located in the path /etc/nginx/sites-available
, in your server
block you must write the 2 lines that refer to your certificate and key.
Inside the server
block you must have:
ssl_certificate_key /etc/nginx/ssl/nameofkey.key;
ssl_certificate /etc/nginx/ssl/nameofcertificate.crt;
Where in each line you specify the path of the files.
来源:https://stackoverflow.com/questions/62492978/how-to-install-ssl-certificate-text-on-ubuntu-nginx