如何在 Nginx 中实现 Drupal“双重 gzip”预防?

如何在 Nginx 中实现 Drupal“双重 gzip”预防?

Drupal 附带的默认 .htaccess 中有以下部分:

# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

我没有使用过 Drupal,但在其他使用 Nginx 作为 Web 服务器的项目中,我从未遇到过“双重 gzip”问题。

这有多必要,以及实现这一点的最佳 nginx 指令是什么?

注意:我也将这个问题发布到了 drupal.stackexchange.com,但我觉得这不一定是 Drupal 特有的问题,所以我也在这里发布了它。

相关内容