系列文章目录
一、nginx软件模块学习
二、项目中常用的功能模块
1.标准的http功能模块集合
nginx http功能模块 | 功能说明 |
---|---|
http_core_module | 包括一些核心的http参数配置,对应nginx的配置为http区块部分 |
http_access_module | 访问控制模块,用来控制网站用户对nginx的访问 |
http_gzip_module | 压缩模块,对nginx返回的数据压缩,属于性能优化模块 |
http_fastcgi_module | fastcgi模块,和动态应用相关的模块 |
http_proxy_module | 代理模块 |
http_upstream_module | 负载均衡模块,可以实现网站的负载均衡以及节点健康检查 |
http_rewrite_module | URL地址重写模块 |
http_limit_conn_module | 限制用户的并发连接以及请求数 |
http_limit_req_module | 定义的key限制nginx请求过程的速率 |
http_log_module | 访问日志模块,指定格式记录nginx客户访问日志 |
http_auth_basic_module | web认证,设置web用户通过账号和密码访问nginx |
http_ssl_module | 加密的http |
http_stub_status_module | 记录nginx基本访问状态信息 |
以上部分功能模块,绝大部分默认情况都会自动安装到nginx软件中,通过调整相应参数,达到性能优化的目的;
2.以tree型结构了解nginx的目录
rpm -qa tree <==是否安装
yum -y install tree <==安装
[root@root nginx]# tree /opt/nginx/
/opt/nginx/
├── cache
├── client_body_temp
├── conf #包含nginx所有的配置文件目录,很重要
│ ├── fastcgi.conf # fastcgi相关参数配置
│ ├── fastcgi.conf.default # fastcgi.conf的默认文件备份
│ ├── fastcgi_params #fastcgi的参数文件
│ ├── fastcgi_params.default #fastcgi的参数文件默认备份
│ ├── koi-utf
│ ├── koi-win
│ ├── mime.types #媒体类型
│ ├── mime.types.default
│ ├── nginx.conf #nginx默认主配置
│ ├── nginx.conf.default
│ ├── scgi_params
│ ├── scgi_params.default
│ ├── tcp.d
│ │ └── example.conf
│ ├── uwsgi_params
│ ├── uwsgi_params.default
│ └── win-utf
├── fastcgi_temp #fastcgi 临时数据目录
├── html #默认访问目录
│ ├── 50x.html
│ ├── error
│ │ ├── HTTP400.html
│ │ ├── HTTP401.html
│ │ ├── HTTP403.html
│ │ ├── HTTP404.html
│ │ ├── HTTP500.html
│ │ ├── HTTP501.html
│ │ ├── HTTP502.html
│ │ ├── HTTP503.html
│ │ ├── HTTP520.html
│ │ ├── HTTP521.html
│ │ └── HTTP533.html
│ └── index.html #默认首页面
├── logs #nginx默认日志路径 包括错误日志以及访问日志
│ ├── access.log
│ ├── error.log
│ ├── nginx.pid #nginx的pid文件,nginx进程启动后,会把所有进程的id好写入这个文件里
│ └── tcp.log
├── proxy_temp #临时目录
├── sbin #nginx命令目录
│ └── nginx #启动明林
├── scgi_temp
├── static
└── uwsgi_temp