Skip to content

ROOT_URL dynamically set via HTTP Header (X-Forwarded-Proto and X-Forwarded-Host) #17648

Closed
@FootStark

Description

@FootStark

Feature Description

I have 2 reverse proxies set up to access the same Gitea-backend (one for win-auth and one for basic auth). Authentication by Reverse proxy is working great, my only remaining issue is that the Git-clone-URLs on the Gitea pages contain the wrong link for one of the proxies.

My idea is: Can the ROOT_URL used to create absolute links be set/processed dynamically for a request when a reverse proxy is involved? Industry standard for the headers should be X-Forwarded-Host and X-Forwarded-Proto (obviously only if coming from an allowed address in REVERSE_PROXY_TRUSTED_PROXIES). I think that would be a suitable solution for #6397, too.

I currently have a workaround in place rewriting links in button[data-link] when the page is returned, but it would be nice to have it build in.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions