Skip to content

Commit

Permalink
Fixed Apache configuration for gzipped assets: FilesMatch and Locatio…
Browse files Browse the repository at this point in the history
…nMatch cannot be nested.
  • Loading branch information
milgner committed Sep 6, 2011
1 parent 9584e15 commit 5e2bf4d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions railties/guides/source/asset_pipeline.textile
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,16 @@ For Apache:
# 2 lines to serve pre-gzipped version
RewriteCond %{REQUEST_FILENAME}.gz -s
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>

# 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>

For nginx:
Expand Down

0 comments on commit 5e2bf4d

Please sign in to comment.