+2 votes
in Web & Google by (74.2k points)

In the log file of Nginx, I have the following warning message. How can I get rid of this warning message?

2018/06/19 15:17:40 [warn] 12638#12638: duplicate MIME type "text/html" in /etc/nginx/nginx.conf:34

I have the following gzip_types in my nginx.conf file.

gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml application/xhtml+xml image/svg+xml image/x-icon; 

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

You need to remove the MIME type "text/html" directive from gzip_types to fix this error. "text/html" is gzipped by default. Your gzip_types should be as follows:

gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml application/xhtml+xml image/svg+xml image/x-icon;


...