On May 29, 9:07 am, Mike Orr <sluggos...@gmail.com> wrote:
> On Fri, May 28, 2010 at 3:44 PM, Graham Dumpleton
>
>
>
>
>
> <graham.dumple...@gmail.com> wrote:
>
> > On May 27, 6:43 am, Gustavo Narea <m...@gustavonarea.net> wrote:
> >> Hello,
>
> >> > This would also be a good place to add a level of indirection and
> >> > instead of specifying a fs path for the file to serve, it would be
> >> > better to specify an abstract path that the middleware would rewrite
> >> > as necessary and possibly use the wrapped app again to get the actual
> >> > response body. This would allow better flexibility such as for serving
> >> > those files from resources or archives. One thing to note is that one
> >> > can go as far as necessary with that path rewriting, for example an
> >> > app wants to serve a user avatar and sends "X-Sendfile: /avatar/
> >> > username" and given our implementation stores those in in GAE blobs it
> >> > might make a lookup to get a blob id for that username and then
> >> > rewrite the response headers as necessary so that frontend serves the
> >> > actual data.
>
> >> That's interesting, but something like that would need a different
> >> name because it's not what X-Sendfile is meant to do.
>
> > The CGI specification defines the ability to return a 'Location' in
> > conjunction with a '200' response. The specified path would then be
> > interpreted by the web server as a sub request. The target of the sub
> > request could be a static file mapped into URL namespace or another
> > dynamic resource. The X-Accel-Redirect in nginx is effectively the
> > same thing.
>
> > The difference between nginx and Apache is that where you want to send
> > a static file which should be private, it is easier in nginx as they
> > have a special keyword in the configuration such that you can mark a
> > URL mapping as private and so only usable by a sub request. In Apache
> > you have to use a mod_rewrite rule to impose the restriction that
> > certain URLs should only be accessible as a sub request.
>
> I thought the goal was to send an arbitrary file no matter whether it
> was in the URL space or not. So the X-Sendfile argument would be the
> filesystem path, not a URL. Otherwise it can't do what FileApp does.
Someone mentioned introducing a level of indirection. I was pointing
out that X-Accel-Redirect and Location both allow that concept.
Graham
--
You received this message because you are subscribed to the Google Groups "Paste Users" group.
To post to this group, send email to paste-users@???.
To unsubscribe from this group, send email to paste-users+unsubscribe@???.
For more options, visit this group at http://groups.google.com/group/paste-users?hl=en.