docs: X-Sendfile/X-Accel-Redirect
Closes #884. Needs https://github.com/caddyserver/caddy/pull/6429.
how to deal with that if we're storing files in AWS S3-like storages?
It looks like this is missing sending the X-Accel-Mapping header that Symfony needs to generate the correct redirect. See https://mattbrictson.com/blog/accelerated-rails-downloads for how this works on RoR (Symfony behaves the same).
@nicolas-grekas If I am understanding correctly, this is a header sent from the webserver to PHP?
@withinboredom correct, to advertise the mapping between URL prefix and internal path.
I think this is doable, just needs to be documented. I'll take a look later today.
@nicolas-grekas it's not necessary because we change the root directory (see also https://github.com/dunglas/frankenphp-demo/pull/28)
What problems did you have?
What problems did you have?
Only my comments on the review. And one of them turned out to be wrong assumptions on my end anyway.
With this simple config:
request_header X-Sendfile-Type x-accel-redirect
request_header X-Accel-Mapping /private-files=
intercept {
@accel header X-Accel-Redirect *
handle_response @accel {
root * /private-files
rewrite * {resp.header.X-Accel-Redirect}
method * GET
header -X-Accel-Redirect
header -X-Accel-Buffering
file_server
}
}
php_server
Each response produces this error output:
ERROR frankenphp the current responseWriter is not a flusher {"error": "feature not supported"}
Can anyone confirm / reproduce that?
FrankenPHP: v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=