Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy adds standard headers related to request forwarding #13

Closed
analogrelay opened this issue Mar 12, 2020 · 10 comments · Fixed by #225
Closed

Proxy adds standard headers related to request forwarding #13

analogrelay opened this issue Mar 12, 2020 · 10 comments · Fixed by #225
Assignees
Labels
Priority:0 Used for divisional .NET planning Type: Enhancement New feature or request User Story Used for divisional .NET planning

Comments

@analogrelay
Copy link
Member

  • X-Forwarded-Proto
  • X-Forwarded-Host
  • X-Forwarded-For
  • X-Client-Cert
  • Forwarded (yes, there's a chicken-and-egg problem but I see no reason we can't break that cycle by implementing it).
@analogrelay analogrelay added the Type: Enhancement New feature or request label Mar 12, 2020
@analogrelay analogrelay added this to the 1.0.0-preview1 milestone Apr 8, 2020
@Tratcher Tratcher self-assigned this Apr 21, 2020
@Tratcher
Copy link
Member

Planning notes: We need a minimal implementation of this for preview1. E.g. automatically append forwarders without any configurability.

@davidni
Copy link
Contributor

davidni commented Apr 30, 2020

I can help with the minimal implementation. I already have it coded up to append X-Forwarded-For, X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Proto, as well as RFC7239 Forwarded.

Because of possible URL transformations, we also add a non-standard header with the full original incoming url.

Tratcher added a commit that referenced this issue May 1, 2020
Tratcher added a commit that referenced this issue May 1, 2020
Tratcher added a commit that referenced this issue May 1, 2020
@Tratcher
Copy link
Member

Tratcher commented May 1, 2020

I did the minimal work for preview1 in #133. Moving this out of the preview1 milestone for further development.

@Tratcher Tratcher modified the milestones: 1.0.0-preview1, 1.0.0 May 1, 2020
@Tratcher
Copy link
Member

Tratcher commented May 1, 2020

Design: I expect this to overlap heavily with the request transformation infrastructure we're designing in #21. We wouldn't necessarily ask you to define these headers in config (though nginx does), but we would use the same infrastructure to actually do the transformations.

@Tratcher
Copy link
Member

Yes this does align with the transforms, but we don't need another middleware to add transforms per request. We can pre build the transforms when building the config for each route/backend, then we can run them per request with minimal overhead.

@damianh
Copy link

damianh commented May 22, 2020

I think you should also consider supporting X-Forwarded-PathBase. It is first class supported in ProxyKit for reasons described in this readme: https://github.com/ProxyKit/HttpOverrides . If this deserves it's own issue, let me know.

@Tratcher
Copy link
Member

Tratcher commented Jun 4, 2020

@Tratcher Tratcher modified the milestones: 1.0.0, 1.0.0-preview2 Jun 9, 2020
@Tratcher Tratcher linked a pull request Jun 17, 2020 that will close this issue
@damianh
Copy link

damianh commented Jun 23, 2020

@Tratcher Yes am aware of the at-startup approach, however I am suggesting per-request should be supported.

@Tratcher
Copy link
Member

@damianh sending x-forwarded-PathBase was implemented in YARP as part of #225. Filed dotnet/aspnetcore#23263 for receiving it.

@damianh
Copy link

damianh commented Jun 23, 2020

Excellent!

@samsp-msft samsp-msft changed the title Implement Forwarded Headers Proxy adds standard headers related to request forwarding Oct 21, 2020
@samsp-msft samsp-msft added the User Story Used for divisional .NET planning label Oct 21, 2020
@samsp-msft samsp-msft added the Priority:0 Used for divisional .NET planning label Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:0 Used for divisional .NET planning Type: Enhancement New feature or request User Story Used for divisional .NET planning
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@analogrelay @damianh @Tratcher @davidni @samsp-msft and others