Nginx -Web服务器/反向代理/负载均衡

Nginx 大揭秘:从安装到负载均衡,一站式解锁其强大功能,让你的服务器性能飙升


以赛促学内容,大概率感觉会使用nginx做web服务,特对nginx做总结归纳.

Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的。从2004年发布至今,凭借开源的力量,已经接近成熟与完善。Nginx功能丰富,可作为HTTP服务器,也可作为反向代理服务器,邮件服务器。
官网:http://nginx.org/ https://github.com/nginx/nginx.org
在这里插入图片描述

一、web服务

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
高可用 keepalived
在这里插入图片描述在这里插入图片描述

1.1 nginx安装

# 查询
nginx -v #安装版本
dnf search  nginx
#安装
dnf install nginx -y
# 查找配置文件
rpm -qa |grep nginx
rpm -qa |grep nginx
rpm -qc nginx-1.20.1-10.el9.x86_64
vim /etc/nginx/nginx.conf
#验证配置文件,也显示位置
nginx -t 
......
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
......
#启动
systemctl enable --now nginx.service
systemctl status nginx.service
ss -ntlp |grep 80

安装验证
在这里插入图片描述

在这里插入图片描述

1.2 配置文件

在这里插入图片描述

#备份配置文件
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
#重新配置文件
touch nginx.conf
vim nginx.conf
...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值