Closed ralfonso-directnic closed 9 years ago
Ok, a little more digging, I've found the issue is the use of acl backend in HA proxy, so I'm going to close this issue
Is there a particular use case that you're trying to accomplish? We could look at adding support for this in the future.
Also, this might be something we want to clarify in the documentation.
Hi @richarddli I have a couple micro services that don't use subdirectories and of course haproxy is doing acl routing with sub directories which makes the whole thing more trouble if I have to re-wire those services to answer on a sub directory url instead of the root url.
I patched the code to instead get a numeric hash of the service_name, turn that into a port, and then write new frontends that bind to a port ie ( bind *:8143) and use the specific backend. Ostensibly now when I wire up mutliple services they would each have their own port bound. The hashing is a bit simple at this point, I'll have to explore how much the possibility of collision is, however that's easily remedied by changing the name. I also changed watson to use a service_name from the config file in support of removing the name from the url
Here is whats in my haproxy conf now
# Last update Tue Aug 11 12:34:25 2015
# //localhost/ips -> (random) http://ips.foobar.com; http://ips.foobar.com;
global
daemon
maxconn 256
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend FE_ips
bind *:8299
mode http #if you had a tcp service and use tcp://service for url mode would be tcp
use_backend BE_ips
backend BE_ips
server ips.foobar.com_80 ips.foobar.com:80 maxconn 32
You can see the changes here https://github.com/ralfonso-directnic/bakerstreet
Resolved in 0.5 release.
I'm just setting this up, so forgive me if I've missed something. I've setup a test service that returns an location lookup for an ip service.
I would normally request to this server at http://ips.foobar.com:8001/8.8.8.8 and get something like
I get a 503 error message with the above config, If I add a "name" to the url
Then I can call it successfully like so:
The application returns an error because that subfolder is being passed, is that the correct understanding?
Any way to define a "name" without making it part of the micro service url? Seems like a odd limitation, perhaps I'm missing something?