HTTP gzip directives

gzip_comp_level directive

HTTP/server/location; default 1; range 1–9. Balance compression cost and size.

Formal Syntax & Structure

nginx syntaxnginx
gzip_comp_level level;

Parameters & Attributes

NameTypeDescription
levelinteger 1–9Compression effort; measure CPU and transfer trade-offs.

Working Example

Example Snippetnginx
gzip_comp_level 3;
Nginx Reference