Web项目之Nginx配置文件篇

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值