161

I have this in Nginx configuration files

gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

but Nginx give error when starting up

[warn]: duplicate MIME type "text/html" in /etc/nginx/nginx.conf:25

What is actually duplicate to text/html? Is it text/plain?

1 Answer 1

305

For the option gzip_types, the mime-type text/html is always included by default, so you don't need to specify it explicitly.

Sign up to request clarification or add additional context in comments.

4 Comments

Relevant docs: wiki.nginx.org/HttpGzipModule#gzip_types Enables compression for additional MIME-types besides "text/html". "text/html" is always compressed.
the same applies to i.a. charset_types
The same applies to sub_filter_types as mentioned in nginx.org/en/docs/http/…: Enables string replacement in responses with the specified MIME types in addition to “text/html”.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.