Nginx学习笔记——配置文件结构

php中文网
发布: 2016-07-29 08:56:37
原创
1098人浏览过

以下内容翻译自nginx官方文档,[原文地址]。


nginx由模块组成,这些模块由配置文件中的指令进行控制。

nginx consists of modules which are controlled by directives specified in the configuration file.

指令分为简单指令和块指令。

Directives are divided into simple directives and block directives.

一个简单指令由名称和参数组成,用空格分开,以分号结束。

A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;).

一个块指令和简单指令有相同的结构,但是以花括号包围的一组额外命令结尾,而不是以分号结尾。

A block directive has the same structure as a simple directive, but instead of the semicolon it ends with a set of additional instructions surrounded by braces ({ and }).

如果一个块指令可以再花括号内包含其他指令,则称该块指令为一个上下文(例如:events、http、server和location)

知周AI笔记
知周AI笔记

一款本地轻量级markdown AI笔记软件

知周AI笔记 53
查看详情 知周AI笔记

If a block directive can have other directives inside braces, it is called a context (examples: events, http, server, and location).

在配置文件中的所有上下文(context)之外的指令被认为是在main上下文中。

Directives placed in the configuration file outside of any contexts are considered to be in the main context.

events和http指令在main上下文中,server在http上下文中,location在server上下文中。

The events and http directives reside in the main context, server in http, and location in server.

其余的在#后面的行是注释。

The rest of a line after the # sign is considered a comment.

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了Nginx学习笔记——配置文件结构,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号