-
Notifications
You must be signed in to change notification settings - Fork 617
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
Drop default port from request #90
Comments
i change the tag, and now do not work without 443 2016/04/26 15:43:45 [INFO] consul: Health changed to #2208 |
finally it works but i need define 2 routes 2016/04/26 15:46:29 [INFO] Updated config to all traffic is https, only 443 port is open, see the first comment. it is a bug or a feature? |
Hmm, that looks like a bug. I'll have a look. |
My guess is the same thing happens when you add a route for In both cases the This would only become a problem if you want to match on certain protocols I guess which I'm going to address when introducing the new prefix syntax as described in #42. I guess dropping the default port from the incoming request is what you would expect to happen. But there is a small chance that this will break someones setup if they have a prefix
|
* Drop the default port from the hostname of an incoming request so that a route for foo.com/ is matched for http://foo.com/ http://foo.com:80/ https://foo.com/ https://foo.com:443/
@mazhack I've pushed a fix for this into a branch. I still need to add a switch to the configuration but could you check whether that works for you? |
Perfect, this fix my problems in ticket #87 too. Now i can redirect traffic using the protocol default port. Thank you. I am using fabio in production and is amazing!!! |
Would it make any sense to strip away fabio's own port entirely from It seems like it's hard to run fabio as a service in e.g. mesos/marathon and use a host+url based routing. |
@ksoftirqd Can you give a concrete example? |
If fabio gets assigned a dynamic port on which it is available for other services, services would need to connect to http://host:<random_port>/ and routing and tags in consul would need to have that port as well. |
I think the issue is similar with http clients adding the port to the host header when connecting via a non-standard port: IMHO, I am ok with the way fabio treats this, as it is explicit in its urlprefix host registration. However, I can see the usefulness of adding a config option to have fabio match the host header while ignoring the port. IE: for a service with tag |
What i tried to say is that fabio's own port should not probably be taken into account in routing rules. Just to illustrate my point, here is an analogy with nginx:
No matter what port is used by nginx to listen on, second server stanza will be used for all requests where
As of now, if we want to use host based routing in fabio, we have to append fabio's port to all services' tags ( |
@ksoftirqd Why are you running fabio on a random port? Its main use case is to route incoming traffic from the internet to frontend services (FE-BE or N-S) and not between services (BE-BE or E-W). For that you use service discovery. I'm assuming that you are trying to use fabio for BE-BE routing because you try to put it into the For FE-BE routing to work you usually run fabio on a well known port since you need to configure your inbound LB (which listens to 80/443) to forward traffic to the fabio instances. If fabio is your internet facing LB then you need to run it on 80/443 anyway. Please have a look at https://github.com/ebay/fabio/wiki/Deployment. But maybe I'm missing something here and if so please explain. |
Yes, we want to use it for BE-BE routing/load balancing, only because service discovery by itself doesn't do a very good job of spreading a load between available instances. If you run fabio on port 80/443 it works as expected (change 23a1aca). It would be really great if fabio could be used in the same way on any port (without a need to append fabio's current non standard port to any of the routing rules). My question is why not just strip away a port portion from every request's hostname before looking it up in the routing table? :-) Thanks |
@ksoftirqd I need to think about that. You may be right that this isn't really necessary. For now you can work around that by registering the route as |
That was added with #163 |
2016/04/26 15:30:40 [INFO] consul: Using tag prefix "fabio_prod-"
2016/04/26 15:30:40 [INFO] consul: Watching KV path "/fabio_prod/config"
2016/04/26 15:30:40 [INFO] consul: Manual config changed to #1
2016/04/26 15:30:40 [INFO] HTTPS proxy listening on :443 with certificate /etc/fabio/ssl/wildcard_lostaxis_com.ca-bundle
2016/04/26 15:30:40 [INFO] Updated config to
2016/04/26 15:30:40 [INFO] consul: Health changed to #2181
2016/04/26 15:30:40 [INFO] Updated config to
route add losmovilesapi_lostaxis losmovilesapi.lostaxis.com/ http://192.168.100.123:32774/ tags "losmovilesapi.lostaxis.com,fabio_prod-losmovilesapi.lostaxis.com/"
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:41 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:42 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
2016/04/26 15:30:42 [WARN] No route for losmovilesapi.lostaxis.com:443/v1/driver/13543547/835
¿the port 443 is not removed from route?
losmovilesapi.lostaxis.com:443/ != losmovilesapi.lostaxis.com/
The text was updated successfully, but these errors were encountered: