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

Should rewrite the Host Header #75

Closed
smancke opened this issue Apr 6, 2016 · 8 comments
Closed

Should rewrite the Host Header #75

smancke opened this issue Apr 6, 2016 · 8 comments
Milestone

Comments

@smancke
Copy link
Contributor

smancke commented Apr 6, 2016

Following the HTTP1.1 spec, rfc2616-sec14,
a proxy has to rewrite the host header:

An HTTP/1.1 proxy MUST ensure that any request message
it forwards does contain an appropriate Host header field
that identifies the service being requested by the proxy.

This is also, how e.g. nginx behaves.
And it is needed, if the upstream server are using a virtual host configuration.

Here there is a possible fix for it:
https://github.com/smancke/fabio/tree/proxy-header-handling

And we had already some discussion about that in #72

@manos
Copy link

manos commented Aug 7, 2017

+1
I'm trying to add a route for /favicon.ico -> www.domain.com/ and www.domain.com is fronted by cloudfront. If it doesn't get Host: www.domain.com, it can't serve favicon.ico for me.

Perhaps a workable solution here would be adding opts "host=www.domain.com" to the route -- if it supported that :)

@manos
Copy link

manos commented Aug 16, 2017

@magiconair does the above comment make sense?

@magiconair
Copy link
Contributor

Hi @manos , sorry for the delay. I was on vacation for a couple of weeks and I'm catching up now. I think what you're suggesting makes sense.

@magiconair
Copy link
Contributor

@manos the host=www.domain.com option has been added with #294

@magiconair magiconair added this to the Unplanned milestone Oct 10, 2017
@ragunathp
Copy link

Hi,
Is this feature available in 1.5.2? Based on the document reference https://github.com/fabiolb/fabio/wiki/Routing#manual-overrides, it seem to be available with the option for "host=name". Could you please confirm?

My use case is to configure docker HRM endpoint in fabio and I face the issue.
Works fine when I do, curl -H 'Host: xyz.docker-hrm.example.com" http://fabio-ip:9999/app/somepath
But the issue exists while hitting from browser http://fabio-ip:9999/app/somepath.
Option configured in fabio as "strip=/app host=xyz.docker-hrm.example.com"
The '$request_host' in fabio is not changed to 'xyz.docker-hrm.example.com'
Is it something I am missing?

@magiconair
Copy link
Contributor

This has been fixed in #375 which is currently on master. I'll cut a 1.5.3 today to roll this out since the metrics refactor is going to take longer.

@ragunathp
Copy link

Thank you looking forward for 1.5.3 release.

@magiconair
Copy link
Contributor

So the host=dst option implements the original desired behavior. host=dst was added with #294. In addition to host=dst you can use host=www.mydomain.com to set the exact host header.

1.5.3 is released

@magiconair magiconair modified the milestones: Unplanned, 1.5.3 Nov 3, 2017
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

4 participants