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.

相关推荐
小天源5 小时前
让访问数据可解释:IP 地球大屏、地区库更新与运行维护设计
网络·网络协议·tcp/ip
万年咸鱼6 小时前
WebSocket、Socket 与 HTTP 的区别详解
websocket·网络协议·http
万年咸鱼6 小时前
HTTPS 是如何保证传输安全的?
网络协议·安全·https
隐擎fox7 小时前
深入 Android 移动端风控与协议层对抗:内核级虚拟环境检测、网络堆栈特征伪装与住宅 IP 协同实战
android·网络·python·网络协议·tcp/ip
Da Da 泓7 小时前
[项目] --- 基于websocket的网页五子棋(可多用户)
网络·websocket·网络协议·多线程·项目
步行cgn9 小时前
HTTP 常用请求方法详解
网络·网络协议·http
2501_9159090610 小时前
抓包工具断点拦截是什么?如何半路拦截修改 HTTP 请求
网络协议·计算机网络·网络安全·adb·https·udp
壹知10 小时前
三台路由器,一条静态路由都没配错,ping 依然不通
网络协议
xiaoqiMikko11 小时前
Redis 实战(二):宕机会丢多少数据 —— kill -9 与真断电下 RDB / AOF 逐个实测(6.2.4)
redis·后端
智购科技无人售货机工厂12 小时前
MQTT还是HTTP?无人售货机弱网通信协议选型与带宽优化实战~YH
网络·网络协议·http