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.

相关推荐
卓伊凡27 分钟前
详细讲述优雅草蜻蜓I即时通讯私有化中xmpp服务中的tigase的角色与作用深度分析-卓伊凡|bigniu
网络协议
一只叫煤球的猫1 小时前
基于Redisson的高性能延迟队列架构设计与实现
java·redis·后端
DemonAvenger2 小时前
Go语言实现高并发网络爬虫:技术实践与经验分享
网络协议·架构·go
望未来无悔5 小时前
HTTPS的概念和工作过程
网络协议·https
回家路上绕了弯6 小时前
Redis 常见使用场景全解析:从基础到实战
redis
EndingCoder8 小时前
HTTP性能优化实战:解决高并发场景下的连接瓶颈与延迟问题
网络·网络协议·http·性能优化·高并发
IPIDEA全球IP代理8 小时前
IPIDEA:全球领先的企业级代理 IP 服务商
网络·网络协议·tcp/ip
十年一梦实验室8 小时前
工业机器人控制系统 IP-PP-EXEC 流水线
网络·人工智能·网络协议·tcp/ip·机器人
DemonAvenger8 小时前
Go中Protocol Buffers与JSON的网络数据序列化
网络协议·架构·go
郭二哈18 小时前
应⽤层协议HTTP
网络·网络协议·http