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

以下内容翻译自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)

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.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值