Setup SSL/ HTTPS on NGINX on CentOS 8/ AlmaLinux 8/ RockyLinux 8

Installing SSL can usually be a very tedious process. Luckily for us, Certbot has an automated script to easily help us to get SSL/ HTTPS set up with a few command lines.

To start, install Certbot

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

sudo dnf install certbot python3-certbot-nginx

Once Certbot is installed, automatically generate an SSL certificate by running this command. You will be prompted with several inputs to fill in.

certbot --nginx

root@nginx \~\]# certbot --nginx \[root@nginx \~\]# certbot --nginx Saving debug log to /var/log/letsencrypt/letsencrypt.log Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): **[email protected]** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: **Y** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: **Y** Account registered. Please enter the domain name(s) you would like on your certificate (comma and/or space separated) (Enter 'c' to cancel): **yourdomain.com** Requesting a certificate for yourdomain.com Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/yourdomain.com/fullchain.pem Key is saved at: /etc/letsencrypt/live/yourdomain.com/privkey.pem This certificate expires on 2022-04-02. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. Deploying certificate Successfully deployed certificate for yourdomain.com to /etc/nginx/conf.d/nginx.conf Congratulations! You have successfully enabled HTTPS on yourdomain.evoxt.com We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - If you like Certbot, please consider supporting our work by: \* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate \* Donating to EFF: https://eff.org/donate-le - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \[root@nginx \~\]# With these set up, your domain's SSL setup should be complete. Note: Your browser might still cache the old self-signed certificate, or the certificate will not update, hence still showing insecure SSL. To fix this, try clearing your browser's cache or try accessing your website with a different browser. To check SSL status, try using this [SSL Checker](https://www.geocerts.com/ssl-checker "SSL Checker") from Geocerts.

相关推荐
小刘|4 小时前
Redis 中简单动态字符串(SDS)的深入解析
数据库·redis·bootstrap
O。o.尊都假都6 小时前
UDP协议
linux·服务器·网络·网络协议·udp
pqq的迷弟6 小时前
Redis的过期设置和策略
数据库·redis
2501_916013746 小时前
从一次被抄袭经历谈起:iOS App 安全保护实战
websocket·网络协议·tcp/ip·http·网络安全·https·udp
不剪发的Tony老师7 小时前
Redis 8.0正式发布,再次开源为哪般?
数据库·redis
yangpipi-7 小时前
10.王道_HTTP
网络协议·http·ios
无锡耐特森7 小时前
ProfiNet与CANopen:新能源时代的“语言翻译官”
网络·网络协议
一代...8 小时前
【计网】TCP/IP四层模型(一)
网络协议·tcp/ip·智能路由器
网安小张8 小时前
IP SSL证书常见问题助您快速实现HTTPS加密
tcp/ip·https·ssl
鱼儿也有烦恼8 小时前
Redis最新入门教程
数据库·redis·缓存