# Can't get lighty to compress static rails files

**URL:** <https://www.ruby-forum.com/t/cant-get-lighty-to-compress-static-rails-files/104952>\
**Category:** Deployment\
**Created:** [May 24, 2007, 9:20am UTC](https://www.ruby-forum.com/t/cant-get-lighty-to-compress-static-rails-files/104952 "2007-05-24T09:20:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [May 24, 2007, 9:20am UTC](https://www.ruby-forum.com/t/cant-get-lighty-to-compress-static-rails-files/104952/1 "2007-05-24T09:20:32Z")

</div>

Hi there,

I posted this in the lighttpd forum a few days ago, but didn’t get any  
responses.

I’ve been trying to get lighty to compress my html, css, and javascript  
using mod\_compress. My config (see below) works perfectly for files  
served directly (out of a filesystem directory).

However, no compression is performed for static files from  
mongrel-powered rails applications (via mod\_proxy). The headers indicate  
that the files are served via lighty (Server: lighttpd/1.4.11), whereas  
dynamic content is served by mongrel (Server: Mongrel 1.0.1). No  
‘Content-Encoding: gzip’ header is set, and content is served  
uncompressed.

Can anyone help me with this?

My setup is: Debian 3.1, lighttpd 1.4.11, mongrel 1.0.1, rails 1.2.3

Thanks a lot!  
Ben

Here are the relevant sections of my config file:

* * *

server.modules = (  
“mod\_redirect”,  
“mod\_proxy”,  
“mod\_access”,  
“mod\_fastcgi”,  
“mod\_rewrite”,  
“mod\_compress”,  
“mod\_accesslog” )

$HTTP[“host”] == “[foo.example.com](http://foo.example.com)” {  
proxy.balance = “fair”  
proxy.server = ( “/” =\>  
( ( “host” =\> “127.0.0.1”, “port” =\> 9000 )  
) )  
}

## compress.filetype = (“text/plain”, “text/html”, “text/css”, “text/javascript”)

EOF
