Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

X-Forwarded-Host for marshalUriFromSapi #376

Merged
merged 4 commits into from
Nov 12, 2019
Merged

X-Forwarded-Host for marshalUriFromSapi #376

merged 4 commits into from
Nov 12, 2019

Conversation

boesing
Copy link
Member

@boesing boesing commented Nov 5, 2019

Hey guys,

we are using NGINX+ with loadbalancing to multiple servers which are not aware of external domain names (for reasons).
However, NGINX provides X-Forwarded-Host header to those upstream servers to tell them which external domain was called.

I've added an example on what I would like to expect (even tho that X-Forwarded-Proto is being handled for the https scheme).

Tell me what you think.

@michalbundyra
Copy link
Member

@boesing it makes sense to me.

here is very old PR to fix it in ZendView helper: https://github.com/zendframework/zendframework/pull/2279/files

@boesing
Copy link
Member Author

boesing commented Nov 6, 2019

I've implemented the way on how that might work.
Just a sidenote: I've skipped that "explode" stuff as per documentation this header only contains a single host (and thats, in fact, is the case for NGINX+ tho).
Probably, the guy who implemented that in zendframework/zendframework#2279 was confused by the X-Forwarded-For header.

@boesing
Copy link
Member Author

boesing commented Nov 12, 2019

Would appreciate some review.

/cc @michalbundyra @froschdesign

Copy link
Member

@michalbundyra michalbundyra left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@boesing boesing changed the base branch from master to develop November 12, 2019 13:57
@michalbundyra michalbundyra added this to the 2.2.0 milestone Nov 12, 2019
weierophinney added a commit that referenced this pull request Nov 12, 2019
@weierophinney weierophinney merged commit 6f68fc4 into zendframework:develop Nov 12, 2019
@weierophinney
Copy link
Member

Thanks, @boesing! Will release once #378 is complete.

@boesing boesing deleted the feature/x-forwarded-host branch November 13, 2019 11:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants