分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

Web项目之Nginx配置文件篇

发布时间:2023-09-06 01:47责任编辑:郭大石关键词:Web配置
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配置文件篇

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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved