# Serve static XML files how?

**URL:** <https://www.ruby-forum.com/t/serve-static-xml-files-how/94006>\
**Category:** Rails\
**Created:** [April 17, 2006, 10:43pm UTC](https://www.ruby-forum.com/t/serve-static-xml-files-how/94006 "2006-04-17T22:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [April 17, 2006, 10:43pm UTC](https://www.ruby-forum.com/t/serve-static-xml-files-how/94006/1 "2006-04-17T22:43:46Z")

</div>

Hi,

a Javascript in one of my Rails templates needs to load a static XML  
file. I tried several places to put the actual XML file, and I also  
tried to make the file a rails template (tried both .rhtml and .rxml)  
and access it via a controller action. None of these ways worked. Does  
the lighttpd server know how to serve XML files, or do I need to  
configure it first? Or, is there a good workaround?

Ingo W.

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [April 17, 2006, 10:54pm UTC](https://www.ruby-forum.com/t/serve-static-xml-files-how/94006/2 "2006-04-17T22:54:46Z")

</div>

Ingo W. wrote:

> Hi,
> 
> a Javascript in one of my Rails templates needs to load a static XML  
> file. I tried several places to put the actual XML file, and I also  
> tried to make the file a rails template (tried both .rhtml and .rxml)  
> and access it via a controller action. None of these ways worked. Does  
> the lighttpd server know how to serve XML files, or do I need to  
> configure it first? Or, is there a good workaround?
> 
> Ingo W.

Why can’t you just put it in public/ under ‘whatever.xml’? Content under  
public gets served static. If for some reason the file is inaccessible,  
it may have something to do with Lighty not serving .xml files under the  
right MIME type.
