Created
January 19, 2016 06:05
-
-
Save huangguozhen/c322add570b3282f2c55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx 配置文件由简单指令和块指令构成。 | |
简单的指令包括名称和参数,并由空格分割,以分号(;)结束 | |
块指令和简单指令有相同的结构,不过他不是使用分号结束,而是使用一对花括号包起来作为一个指令块 | |
如果指令可以包含其他指令块,我们称之为上下文。例如:events,http,server和location | |
events和http指令属于主上下文。server包含于http,location包含于server | |
``` | |
http { | |
server { | |
} | |
} | |
``` | |
nginx先确定使用哪个server处理请求,然后匹配请求中包头的URI来决定选择那个location指令 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment