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

Path problem #124

Closed
cabrinoob opened this issue Jul 7, 2016 · 4 comments
Closed

Path problem #124

cabrinoob opened this issue Jul 7, 2016 · 4 comments
Milestone

Comments

@cabrinoob
Copy link

Hi,
I have a use case I cannot resolve with fabio:

I have 2 services "Jack" and "John". Jack has two routes /api/dosomething and /api/dootherthing
John has one route /api/hellojohn

John and Jack are deployed through Docker on the same host and registrator registers them into consul. But I have a path problem : John and Jack are using the same prefix (/api). How can I register them into consul.

I tried to tag them with urlprefix-jack/ and urlprefix-john/ but when I call http://fabio-proxy:9999/john/api/hellojohn I have a 404 error.

I need that http://fabio-proxy:9999/**john**/api/\* will be redirected to http://docker-host:1234/api/*
and http://fabio-proxy:9999/**jack**/api/\* to http://docker-host:5678/api/*

thank you for your help

@magiconair
Copy link
Contributor

You have two options:

  1. All services register their specific routes, e.g. jack urlprefix-/api/a, urlprefix-/api/b and for john urlprefix-/api/c
  2. You register one service with /api and the other ones with their specific routes. This makes sense if hack has urlprefix-/api/a-x and john has only urlprefix-/api/z

@magiconair
Copy link
Contributor

Also, path stripping is not implemented right now. See #44 So if the external URL is http://host.com/john/api then your service needs to register AND respond to /john/api

@cabrinoob
Copy link
Author

ok, thank you. It's clearer.

magiconair added a commit that referenced this issue Dec 21, 2016
This patch adds support for a 'strip=/path' option which will remove
/path from the front of the outgoing request path. For 'strip=/foo'
a request to '/foo/bar' will be matched on '/foo/bar' but forwarded
as '/bar'.

Fixes: #44, #124, #164
magiconair added a commit that referenced this issue Jan 17, 2017
This patch adds support for a 'strip=/path' option which will remove
/path from the front of the outgoing request path. For 'strip=/foo'
a request to '/foo/bar' will be matched on '/foo/bar' but forwarded
as '/bar'.

Fixes: #44, #124, #164
magiconair added a commit that referenced this issue Jan 17, 2017
This patch adds support for a 'strip=/path' option which will remove
/path from the front of the outgoing request path. For 'strip=/foo'
a request to '/foo/bar' will be matched on '/foo/bar' but forwarded
as '/bar'.

Fixes: #44, #124, #164
@magiconair
Copy link
Contributor

Duplicate of #44

magiconair added a commit that referenced this issue Jan 17, 2017
This patch adds support for a 'strip=/path' option which will remove
/path from the front of the outgoing request path. For 'strip=/foo'
a request to '/foo/bar' will be matched on '/foo/bar' but forwarded
as '/bar'.

Fixes: #44, #124, #164
@magiconair magiconair added this to the 1.3.7 milestone Oct 10, 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

2 participants