1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed Apache configuration for gzipped assets: FilesMatch and LocationMatch cannot be nested.

This commit is contained in:
Marcus Ilgner 2011-09-06 16:27:26 +02:00
parent 9584e15d39
commit 5e2bf4de62

View file

@ -414,16 +414,16 @@ For Apache:
# 2 lines to serve pre-gzipped version # 2 lines to serve pre-gzipped version
RewriteCond %{REQUEST_FILENAME}.gz -s RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L] RewriteRule ^(.+) $1.gz [L]
# without it, Content-Type will be "application/x-gzip"
<FilesMatch .*\.css.gz>
ForceType text/css
</FilesMatch>
<FilesMatch .*\.js.gz>
ForceType text/javascript
</FilesMatch>
</LocationMatch> </LocationMatch>
# without these, Content-Type will be "application/x-gzip"
<FilesMatch "^/assets/.*\.css.gz$">
ForceType text/css
</FilesMatch>
<FilesMatch "^/assets/.*\.js.gz$">
ForceType text/javascript
</FilesMatch>
</plain> </plain>
For nginx: For nginx: