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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy