企业网站的分类有哪三种,网站建设硬件条件,重庆系统建站怎么用,jsp网站开发的教材1.nginx简介#xff1a; nginx是企业高可用的web服务器#xff0c;nginx也可用来做反向代理服务器器#xff0c;具有高并发#xff0c;占用资源少#xff0c;功能丰富#xff0c;也可以作为简单的负载均衡。 nginx在企业中的功能#xff1a; web服务软件 反向代理服务器…1.nginx简介 nginx是企业高可用的web服务器nginx也可用来做反向代理服务器器具有高并发占用资源少功能丰富也可以作为简单的负载均衡。 nginx在企业中的功能 web服务软件 反向代理服务器 前端数据缓存服务器 2.为什么nginx性能高于apache
当查询事物时nginx使用了epoll模型apache使用的是传统的selectepoll类似会将查询事物标上序号方便下次查询。传统的select查询需要将事物逐一查询。
3.安装nginx
安装nginx需要配置epel源
cd /etc/yum.repos.d/
vim epel.repo
[epel]
nameepel
baseurlhttps://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck0yum install -y nginx4.nginx配置文件
nginx配置文件/etc/nginx/nginx.conf
nginx额外配置文件/etc/nginx/conf.d/*.conf
nginx配置文件简单说明 [rootmanage ~]# more /etc/nginx/conf.d/vhosts.conf
server { server区块listen 80; 服务器端口server_name bbs.yunjisuan.com; 服务器域名location / { location区块 root /usr/share/nginx/html/bbs; 定义首页文件存放的站点目录index index.html index.htm; 定义首页文件去寻找呢些
}
}5.nginx的一些常用功能
nginx location
location根据不同的url来执行不同的应用
location语法
location 匹配标识 匹配的网站地址 {匹配到后执行的片段}
/
^~/images/
~*\.(gif|jpg)
/adc/
/
nginx rewrite:
实现url重写
rewrite语法
rewrite regexp正则匹配 重写的网址[flag]
location / {
root html;
index index.html ;
rewrite ^/xxxxx/(.*) /bbs/$1 last ;}