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 from Geocerts.

相关推荐
开开心心就好27 分钟前
免费刷题软件推荐,支持导入题库自动判题
网络·网络协议·tcp/ip·jupyter·智能手机·电脑·idea
沐沐师31 分钟前
Redis 入门教程
redis·nestjs
幼儿园蛋小黄3 小时前
基于 TCP 的嵌入式网络通信学习总结
网络协议·学习·tcp/ip
吃饱了得干活3 小时前
Redis 从单机到集群:持久化、主从复制、哨兵与集群完全指南
redis·后端
星星落进兜里4 小时前
Redis 内存缓存,面试补充
数据库·redis·面试
木井巳4 小时前
【网络原理】TCP/IP 协议栈
网络·网络协议·tcp/ip·udp
++==4 小时前
RPC:grpc的使用与安装、server和client的使用示例、lsb_relese、自定制协议(LVC)+protobuf的RPC调用框架的实现
网络·网络协议·rpc
小程故事多_804 小时前
企业AI对话记忆架构实战,告别单一Redis存储,搭建长短效协同的记忆体系
人工智能·redis·架构
Lsetea4 小时前
ACME 报 rate limit:Let‘s Encrypt 限速类型与重试策略
运维·https·证书·ssl·acme
青瓦梦滋5 小时前
NAT技术
linux·服务器·网络·网络协议·tcp/ip