# How to do force apache to handle static request

**URL:** <https://www.ruby-forum.com/t/how-to-do-force-apache-to-handle-static-request/195478>\
**Category:** Rails\
**Created:** [September 23, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/how-to-do-force-apache-to-handle-static-request/195478 "2010-09-23T16:40:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [September 23, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/how-to-do-force-apache-to-handle-static-request/195478/1 "2010-09-23T16:40:35Z")

</div>

Posted by Amit T. (amit-singh) on 23.09.2010 14:55  
hii all, Am running apche as frontend to mongrel ,i added these line in  
Apache’s httpd.conf file

LoadModule rewrite\_module modules/mod\_rewrite.so

LoadModule proxy\_module modules/mod\_proxy.so

LoadModule proxy\_balancer\_module modules/mod\_proxy\_balancer.so

LoadModule proxy\_http\_module modules/mod\_proxy\_http.so

LoadModule xsendfile\_module modules/mod\_xsendfile.so

XSendFile on

XsendFileAllowAbove on

\<VirtualHost \*:80\>

ServerName src

DocumentRoot C:/InstantRails-2.0-win/rails\_apps/src/public/

ProxyPass / [http://localhost:3000/](http://localhost:3000/)

ProxyPassReverse / [http://localhost:3000](http://localhost:3000)

Now in my application i have to downlaod large stream and i don’t want  
rails to serve it,i would like apache to server this request but with  
current setting rail i serving this request.

this is my code for download

filename = “#{@stream.location}”

response.headers[‘Content-Type’] = “application/force-download”

response.headers[‘Content-Disposition’] = “attachment;  
filename="#{File.basename(filename)}"”

response.headers[“X-Sendfile”] = filename

response.headers[‘Content-length’] = File.size(filename)

render :nothing =\> true

with current setting am able to downlaod files of 1.1. gb only once to  
download it again i have to restart both mongrel and apache…
