码迷,mamicode.com
首页 > Web开发 > 详细

Web项目之Nginx配置文件篇

时间:2018-03-31 10:58:42      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:Nginx   nginx.conf   

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

Web项目之Nginx配置文件篇

标签:Nginx   nginx.conf   

原文地址:http://blog.51cto.com/gameboy/2093254

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!