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): **test@test.com** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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.

相关推荐
子燕若水1 小时前
TLS/SSL加密通信过程全解
网络·网络协议·ssl
细节控菜鸡1 小时前
【2025最新】APP开启了SSL无法被抓包,如何进行调试
网络·网络协议·ssl
2501_915921431 小时前
“HTTPS 个人化”实战,个人站点与设备调试的部署、验证与抓包排查方法
网络协议·http·ios·小程序·https·uni-app·iphone
LB21122 小时前
Redis黑马点评 day01
数据库·redis·缓存
初学小白...3 小时前
TCP实现聊天
网络·网络协议·tcp/ip
彬彬醤4 小时前
如何正确选择住宅IP?解析适配跨境、流媒体的网络工具
服务器·开发语言·网络·网络协议·tcp/ip
希赛网4 小时前
软考软件设计师常考知识点(12):计算机网络
网络协议·tcp/ip·计算机网络·ip·设计语言·软件设计师
爬山算法10 小时前
Redis(78) 如何设置Redis的缓存失效策略?
数据库·redis·缓存
DemonAvenger10 小时前
深入Redis String:从基础到实战,10年经验的后端工程师带你解锁最佳实践
数据库·redis·性能优化
shuair11 小时前
redis大key问题
数据库·redis·缓存