重复的MIME类型“ text / html”?


132

我在Nginx配置文件中有这个

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

但是Nginx在启动时给出错误

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

实际重复text/html什么?是text/plain

Answers:


252

对于该选项gzip_typestext/html默认情况下始终始终包含mime-type ,因此您无需显式指定它。


7
相关文档:wiki.nginx.org/HttpGzipModule#gzip_types Enables compression for additional MIME-types besides "text/html". "text/html" is always compressed.
Frank Farmer

6
同样适用于iacharset_types
wmamrak


这同样适用于sub_filter_types在提到nginx.org/en/docs/http/...启用字符串替换与指定的MIME类型除“text / html的”回应。
famousgarkin
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.