Skip to content

Intercept responses for nginx-like X-Accel-Redirect handling #365

@aleho

Description

@aleho

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions