1.Nginx的基本描述
Nginx是一个web服务器,是用来代理服务。
2.常见的web服务器
Nginx httpd Tengine OpenResty
3.Nginx应用场景
代理 负载均衡 代理缓存(proxy_cache) 静态资源 动静分离 Https
4.Nginx 安装 配置 启动
(1)安装官方仓库源

(2)使用yum直接安装

3.启动Nginx

4.Nginx配置了解
cat /etc/nginx/nginx.conf
user nginx; #nginx进程的用户身份
worker_processes 1; #nginx的工作进程数量
error_log /var/log/nginx/error.log warn; #错误日志的路径【警告级别才会记录】
pid /var/run/nginx.pid; #进程运行后,会产生一个pid
ecents { #事件模型
worker_connections 1024; #每个work能够支持的连接数
use epoll; #每个work能偶支持的连接数
}
http { #接受用户的http请求
include /etc/nginx/mime.types; #包含所有静态资源的文件
default_type application/octer-stream; #默认类型(下载)
日志相关
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main; # 访问日志的路径
#sendfile on;
#tcp_nopush on;
keepalive_timeout 65; #长链接超时时间
#gzip on; #启用压缩功能
#使用Server配置网站, 每个Server{}代表一个网站
server {
listen 80;
server_name test.oldxu.com;
location / { #控制网站访问的路径
root ...;
}
}
include /etc/nginx/conf.d/*.conf; 包含哪些文件
}
5.Nginx 搭建 邮箱网站
(1)注释掉之前的默认网站

(2)编写游戏网站Nginx配置文件

(3)创建放置目录

(4)上传软件

(5)检测语法

(6)重载服务

(7)配置域名解析

(8)Nginx访问

6.Nginx配置虚拟主机有如下三种方式:
方式一:基于主机多IP方式
方式二:基于端口的配置方式
方式三:基于名称方式(多域名方式)
7.io网络模型:
同步
异步
阻塞
非阻塞
同步阻塞
同步非阻塞
异步阻塞
异步非阻塞
https://www.jianshu.com/p/d4f24abc8024?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation