# Static files and mongrel

**URL:** <https://www.ruby-forum.com/t/static-files-and-mongrel/139673>\
**Category:** Mongrel\
**Created:** [June 5, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/static-files-and-mongrel/139673 "2008-06-05T22:47:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![epirsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@epirsch](https://www.ruby-forum.com/u/epirsch)\
**Post date:** [June 5, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/static-files-and-mongrel/139673/1 "2008-06-05T22:47:06Z")

</div>

Hi

how does mongrel (without rails or merb) handles Static files? Do I  
have to create a handler for static file handling?

Thanks

Emmanuel

---

<div class="post-metadata">

**Author:** ![epirsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@epirsch](https://www.ruby-forum.com/u/epirsch)\
**Post date:** [June 5, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/static-files-and-mongrel/139673/2 "2008-06-05T23:13:49Z")

</div>

On Thu, Jun 5, 2008 at 2:45 PM, Emmanuel P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi
> 
> how does mongrel (without rails or merb) handles Static files? Do I have to  
> create a handler for static file handling?

Use the DirHandler. It’s one of the standard handlers bundled with  
Mongrel. If you look at the Mongrel code, it is in the  
mongrel/handlers.rb file.

The general advice, to let whatever is upstream of Mongrel handle  
static files, is good advice, though.

Kirk H.

---

<div class="post-metadata">

**Author:** ![epirsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@epirsch](https://www.ruby-forum.com/u/epirsch)\
**Post date:** [June 5, 2008, 11:53pm UTC](https://www.ruby-forum.com/t/static-files-and-mongrel/139673/3 "2008-06-05T23:53:52Z")

</div>

Oh, I though it was just for Directory listing. Does it handle  
automatically the MIME type? I see in the doc that there are  
references to a mimes.yml

thanks for the advice. This is not meant for production system but  
more simulator so should be fine. Otherwise I use Apache or any other  
web server usually to pick up the static files then have mongrel just  
handle dynamic part

Thanks

Emmanuel
