nginx: [warn] duplicate MIME type "text/html"错误

检查配置文件时提示:nginx: [warn] duplicate MIME type "text/html" in /home/web/nginx/inc/gzip.conf:9

[root@localhost sbin]# ./nginx -t -c /home/web/nginx/nginx.conf
nginx: [warn] duplicate MIME type "text/html" in /home/web/nginx/inc/gzip.conf:9
nginx: the configuration file /home/web/nginx/nginx.conf syntax is ok
nginx: configuration file /home/web/nginx/nginx.conf test is successful

解决方式:去掉下面一行中的“text/html”。

原因:text/html根本就不需要写的,gzip默认就会压缩它的,只不过以前的nginx版本不提示这个警告而已,新版本的会出这个警告。

原文地址:https://www.cnblogs.com/xzlive/p/9379384.html