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

middleware proxy pass origin Host header #2647

Open
3 tasks done
art-frela opened this issue Jun 13, 2024 · 0 comments
Open
3 tasks done

middleware proxy pass origin Host header #2647

art-frela opened this issue Jun 13, 2024 · 0 comments

Comments

@art-frela
Copy link

Issue Description

Requests that reach the final server contain the Host header from the original request. If the destination server checks the header Host (eg: ingress in k8s cluster with Host rules) and if the values ​​do not match, then the request is rejected or etc...

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs

Expected behaviour

proxy replace request.Host to target.URL.Host

Actual behaviour

request.Host stay immutable

Steps to reproduce

  • http server which checks Host header (srv1)
  • http server with echo using middleware proxy (proxy) - target url to srv1, domain for proxy <> domain for srv1
  • run both srv1 and proxy
  • request to proxy

client (localhost) --(Host: proxy.domain.com)--> proxy (proxy.domain.com) --(Host: proxy.domain.com)--> srv1 (srv1.domain.com)

Version/commit

echo v4.12.0

dirty workaround

req.Host = tgt.URL.Host

P.S. Maybe add option to ProxyConfig

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

No branches or pull requests

1 participant