How to disable gzip compression for text/html?

妖精的绣舞 提交于 2021-01-28 08:14:10

问题


My gzip config looks like this:

gzip  on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 1500;
gzip_types text/css application/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype;

You will notice that text/html is not in my list of types, but Chrome is showing that it's gzipped anyway. This article says that text/html is enabled by default. I want to disable it for security reasons. How can I do that?


回答1:


From the docs:

Responses with the “text/html” type are always compressed.

You can disable gzip entirely:

gzip off

This article suggests disabling SSL compression entirely.



来源:https://stackoverflow.com/questions/29779960/how-to-disable-gzip-compression-for-text-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!