Module Webs_kit.Gateway
Gateway interaction.
File serving handoff
val send_file : ?prefix:string -> header:Webs.Http.name -> Webs.Req.t -> (Webs.Resp.t, Webs.Resp.t) Stdlib.result
send_file ~prefix ~header r
is:Ok resp
. An emptyWebs.Http.s200_ok
response withheader
set tor
's request target as transformed byWebs.Http.Path.to_undotted_filepath
and prefixed byprefix
(defaults to"/"
).Error resp
is aWebs.Http.s400_bad_request
if the theWebs.Http.Path.to_undotted_filepath
conversion fails.
Used with the appropriate
header
this allows to handoff the request back to the gateway for it to serve the file. See this section of the web service howto manual.
val x_accel_redirect : Webs.Http.name
x_accel_redirect
is the header name"x-accel-redirect"
used by nginx for internal redirection.
val x_sendfile : Webs.Http.name
x_sendfile
is the header name"x-sendfile"
. Used by Apache and Lightppd for file serving.