LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > sendfile

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2007, 01:55 PM
thijs thijs is offline
Member
 
Join Date: Sep 2006
Posts: 20
Default sendfile

I would like to start using the sendfile feature in Litespeed to serve files that are selected from the filesystem by my Rails app.

I had a look at the sendfile gem but it's not obvious to me how this could be used with Litespeed. Is there anybody that has tried this?
Reply With Quote
  #2  
Old 03-04-2007, 02:53 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Please checkout our wiki

http://www.litespeedtech.com/support...ernal_redirect
Reply With Quote
  #3  
Old 03-12-2007, 03:56 AM
thijs thijs is offline
Member
 
Join Date: Sep 2006
Posts: 20
Thanks, I know about that.

That solution feels to much like security through obscurity to me. I don't feel comfortable putting those files on a publicly accessible location. And somebody could download every single file if the secret location would leak.

Or is there a way to close off the file location?
Reply With Quote
  #4  
Old 03-12-2007, 09:50 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
To block direct access to a directory, just add a rewrite rule at vhost level like

RewriteCond %{REQUEST_URI} ^/blocked/uri/
RewriteRule ^/blocked/uri/ - [R=403,F]

REQUEST_URI is the same as the current URI when accessing the file directly, however, when a request was internally redirected, Current URI is the "/blocked/uri/", while REQUEST_URI is the URI in the original request header.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:24 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.