Skip to content

Support X_FORWARDED_PREFIX HTTP request header #36809

@ebuildy

Description

@ebuildy

Description

Some HTTP reverse-proxy (at least Traefik), send a X_FORWARDED_PREFIX header to backend (here, a Symfony application running on Nginx), if routing configuration use a Path (see example below).

But Symfony ignores it, hence, all routes are broken.

Look like this is possible for CLI, via the router.request_context.base_url parameter (see https://symfony.com/doc/4.1/console/request_context.html).

(Or I missed something about how to configure Symfony behind a reverse-proxy with a path prefix).

Example

  • Public URL is "https://mysite.com/admin/login"
  • Reverse-proxy rules: https => http , route /admin/(.*) => symfony backend /$1
  • Symfony backend receives /login , hence match /login route (which is OK)
  • Symfony backend must generate /admin/login for login route

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help wantedIssues and PRs which are looking for volunteers to complete them.Routing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions