ngnix进阶

ngnix进阶

nginx: [warn] duplicate MIME type "text/html" in /usr/local/nginx/conf/nginx.conf:49

把nginx升级到最新以后,发现用原来的配置启动的时候会提示:
Starting nginx: [warn]: duplicate MIME type “text/html” in /usr/local/nginx/conf/nginx.conf:23

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

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

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

原文地址:https://www.cnblogs.com/xhkj/p/6696656.html