Skip to content

Proxy: always add X-Forwarded-Proto alongside X-Forwarded-For - #62

Merged
bentsku merged 1 commit into
mainfrom
x-forwarded-proto
Oct 14, 2026
Merged

bentsku merged 1 commit into
mainfrom
x-forwarded-proto

Conversation

@purcell

@purcell purcell commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Motivation

This header is used by convention to allow downstream servers to reconstruct the original request URL, even if that request to the proxy server was made via a different protocol from that on which the downstream is listening. A typical use case is when the proxy server listens on https but the downstream backend listens on http.

Changes

Rolo now ensures this header is always present in requests passed to proxy backends.

We only add this header if not provided by a (further) upstream proxy, and if not explicitly overridden programmatically, e.g. by the module-level forward() function.

This header is used by convention to allow downstream servers to
reconstruct the original request URL, even if that request to the
proxy server was made via a different protocol from that on which the
downstream is listening. A typical use case is when the proxy server
listens on https but the downstream backend listens on http.

We only add this header if not provided by a (further) upstream proxy,
and if not explicitly overridden, e.g. by the module-level "forward()"
method.
@purcell
purcell requested a review from bentsku as a code owner October 14, 2026 16:32

@bentsku bentsku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice addition! This might break in a few places downstream where we use the proxy. I need to bump Rolo today so I can take care of fixing this in the bump PR, if we ever need to 👍

@bentsku
bentsku merged commit 82e8a61 into main Oct 14, 2026
7 checks passed
@bentsku
bentsku deleted the x-forwarded-proto branch October 14, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants