HTTP gzip directives

gzip_types directive

HTTP/server/location; adds eligible media types beyond text/html. Wildcard matches all types; review suitability.

Formal Syntax & Structure

nginx syntaxnginx
gzip_types mime-type ...;

Parameters & Attributes

NameTypeDescription
mime-typemedia type (one or more)Additional response types eligible for gzip; text/html is included and * matches any type.

Working Example

Example Snippetnginx
gzip_types text/css application/json;
Nginx Reference