How to install SSL certificate text on Ubuntu nginx

↘锁芯ラ 提交于 2021-01-29 19:21:17

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!