指令

  • tcp_nopush | Syntax: | **tcp_nopush**on|off; | | :—- | —- | | Default: | tcp_nopush off; | | Context: | http, server, location | | Desc: | sendfile 开启的情况下,提高网络包的传输效率 |
  • tcp_nodelay | Syntax: | **tcp_nodelay**on|off; | | :—- | —- | | Default: | tcp_nodelay on; | | Context: | http, server, location | | Desc: | keepalive 连接下,提高网络包的传输实时性 |

压缩指令

  • gzip | Syntax: | **gzip**on|off; | | :—- | —- | | Default: | gzip off; | | Context: | http, server, location, if in location | | Desc: | 是否开启压缩传输 (nginx 压缩,brower 解压) |
  • gzipcomp_level | Syntax: | **gzip_comp_level**_level; | | :—- | —- | | Default: | gzip_comp_level 1; | | Context: | http, server, location | | Desc: | 设置 gzip 压缩级别 |
  • gzip_http_version | Syntax: | **gzip_http_version**1.0|1.1; | | :—- | —- | | Default: | gzip_http_version 1.1; | | Context: | http, server, location | | Desc: | 启用 gzip 压缩的最小版本 |
  • gziptypes | Syntax: | **gzip_types**_mime-type...; | | :—- | —- | | Default: | gzip_types text/html; | | Context: | http, server, location | | Desc: | 可以压缩的类型 |
  • gzipdisable | Syntax: | **gzip_disable**_regex...; | | :—- | —- | | Default: | — | | Context: | http, server, location | | Recommand: | 避免 ie6一下版本不支持
    gzip_disable "MSIE [1-6]\."; |

This directive appeared in version 0.6.23.

扩展压缩模块