2)配置篇
2.1:nginx.conf为主配置文件
2.1.1:nnginx.conf文件是以{}作区域分隔的纯文本配置文件。
2.1.2 Nginx配置文件目录结构
使用tree命令查看目录结构,若提示-bash: tree: command not found 则使用:yum install -y tree
tree /usr/local/nginx/
总结配置文件分布规律:以*.default结尾的为默认的备份文件 带temp字样的为临时目录或文件
nginx/
|-- client_body_temp
|-- conf #包含所有配置
| |-- fastcgi.conf #通用网关接口配置文件
| |-- fastcgi.conf.default #通用网关接口配置文件备份
| |-- fastcgi_params
| |-- fastcgi_params.default
| |-- koi-utf
| |-- koi-win
| |-- mime.types #支持的媒体库类型
| |-- mime.types.default
| |-- nginx.conf #nginx服务主配置文件
| |-- nginx.conf.default
| |-- scgi_params
| |-- scgi_params.default
| |-- uwsgi_params
| |-- uwsgi_params.default
| `-- win-utf
|----fastcgi_temp
|-- html #安装Nginx的默认站点目录
| |-- 50x.html
| -- index.html
| ---- logs #安装Nginx后默认的日志目录
| |-- access.log #访问日志
| |-- error.log #错误日志
| -- nginx.pid
|-- proxy_temp
|-- sbin #可执行主程序文件夹
| -- nginx #Nginx主程序
|-- scgi_temp
-- uwsgi_temp
2.1.3:Nginx功能模块
Nginx之所以流行,是因为它具有强大的模块功能。常用的模块有:
Nginx核心模块
为Nginx配置文件的全局应用。
vim /usr/local/nginx/conf/nginx.conf.default
接下来为标准Http功能模块
其中包含了基本常用的模块
ngx_http_core_module
ngx_http_access_module
ngx_http_gzip_module
ngx_http_ssl_module
ngx_http_status_module #单独添加
ngx_http_auth_basic_module
转载于:https://blog.51cto.com/gameboy/2093254