Caddy allows the responses in reverse_proxy to be intercepted via handle_response like so:
php_fastcgi unix//run/php/fpm.sock {
# FPM needs full application root
root /application/public
@accel header X-Accel-Redirect *
handle_response @accel {
root * /files
rewrite * {rp.header.X-Accel-Redirect}
file_server
}
}
This allows us to send a "private" file from backend that is available locally without having to stream it through PHP.
I haven't found it in the docs (but maybe didn't look carefully enough), can this be done in FrankenPHP?