apache - Gzip 压缩不适用于 HTTPS

标签 apache ssl https gzip

我已经通过我的 .htaccess 中的以下内容为我的网站启用了 gzip 压缩:

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml

这可以正常工作,并且针对未加密的连接压缩内容,但是当发出安全请求时,不会压缩任何内容。有什么想法吗?

我的服务器正在运行 Apache/2.2.14

最佳答案

在您的安全站点的 Apache 配置中(即它谈论端口 443 和 SSL 的部分)检查您是否已通过 AllowOverride 指令启用 .htaccess 文件。

您当前的 AllowOverride 指令可能位于仅与配置非安全端口 80 访问您的服务器有关的部分中。

关于apache - Gzip 压缩不适用于 HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3473680/

相关文章:

c# - https 代理服务器中的 firefox 证书问题

javascript - Node.js https.get 或 https.request 中的 Kerberos 身份验证

apache - Options +Indexes 不会显示文件名

c# - 安全的跨域表单提交

ssl - 如何使用Rabbitmq与SSL通信?

ssl - 由中间 CA(go daddy)签署的有效证书不适用于少数客户(docker alpine)

java - 在 RequestConfig 和 SocketConfig 中设置套接字超时对于 HTTP 和 HTTPS 的工作方式不同

apache - hadoop mapreduce 常见 friend reducer 溢出

php - 301 重定向正在附加 ?_url

javascript - 如何 gzip 或压缩 .json 文件并在前端 .js 中使用它