HTTP gzip directives

gzip directive

HTTP/server/location/if in location; default off. Enables runtime gzip filtering of eligible responses.

Formal Syntax & Structure

nginx syntaxnginx
gzip on | off;

Parameters & Attributes

NameTypeDescription
stateon | offAllow eligible responses to be compressed; avoid secrets mixed with attacker-controlled input.

Working Example

Example Snippetnginx
gzip on;
Nginx Reference