HTTP module 包含 3 个 logical blocks:
http, server, location.
server 包含在 http block 中, location 包含在 server block 或者其他的 location block 中。结构如图:
引用自 <Nginx HTTP server>
全局 directive 和局部 directive 类似普通编程语言:
扫描二维码关注公众号,回复:
1408797 查看本文章
http { # Enable gzip compression at the http block level gzip on; server { server_name localhost; listen 80; # At this stage, gzip still set to on location /downloads/ { gzip off; # This directive only applies to documents found # in /downloads/ } } }