rstudio / redx

dynamic nginx configuration
BSD 2-Clause "Simplified" License
117 stars 27 forks source link

Search for frontend in redis using trailing slashes #22

Closed kippandrew closed 8 years ago

kippandrew commented 8 years ago

CC @aronatkins @CBarraford

aronatkins commented 8 years ago

:hamburger:

cbarraford commented 8 years ago

So i'm a little concerned that we're hardcoding a lucid specific behavior into an open source project. I don't think its reasonable that other people would want this same behavior.

cbarraford commented 8 years ago

I'd like to keep redx agnostic to what its proxying to. Keep it a general use application, not something for lucid specifically. In order to do that, we should be heading towards staying true to RFCs around urls rather than moving away to standards.

prologic commented 8 years ago

:+1: to keeping this agnostic. As the developer of autodock and autodock-hipache I'd love to explore the possibility of writing a new alternative "load balancer" plugin; autodock-redx :)

kippandrew commented 8 years ago

The goal here is not to be coupled to rstudio's internal code base, but rather remove the ambiguity in how redx resolves frontends:

Because its not possible to do any pattern matching when fetching frontends from redis, the frontend has to be an exact match. This means that assuming a request for: www.example.com/foo/, redx will not find a matching frontend if the configured frontend URL is www.example.com/foo. But a request for www.example.com/foo/bar will match.

To me this means is that the actual pattern we are trying to match is www.example.com/foo/*. Given this, it makes most sense to represent this internally using a URI that ends in slash, which is to clarify what URLs should be matched.

prologic commented 8 years ago

Q: How many lb's actually support matching on Path? I'm not sure that hipache does (I could be wrong); I think haproxy supports this?

kippandrew commented 8 years ago

I know nginx and and haproxy can do this (or any high end LB appliance: F5, Netscaler, etc). Not sure about hipache though.

If you're not looking to match on path with redx, this change probably doens't matter.

prologic commented 8 years ago

I also only because of my previous comment to this; I should start considering addthis this as a feature to autodock; but I'd also like to support redx as well in the near future.

cbarraford commented 8 years ago

@prologic can you rephrase your last comment? Not sure i understand what you're saying.

cbarraford commented 8 years ago

@kippandrew Sorry, this merged quicker than i thought it was going to, please update the tests to include trailing slashes https://github.com/rstudio/redx/blob/master/spec/api_spec.moon, also main_spec.moon.

cbarraford commented 8 years ago

@kippandrew also add tests to main_spec.moon showing that using trailing slashes and not still works ok.