Open funkiestj opened 3 years ago
Thank you for raising this issue! I think this would be a great addition. Would you be willing to open a pull request with these changes?
Our contributing guide has some instructions on how to fork the Consul repo and submit a pull request.
ha ha ha, I was hoping a skilled consul developer would do the tedious work of creating a PR and testing.
I will create a PR per the linked to contributing guide but this will have to wait until I can fit it into my work schedule. I'll update this thread when I begin the task. If someone wants it sooner they are welcome to make the PR themself
@dnephin PR submitted. Please, let me know, what I can do to have it in upstream. Thanks!
Feature Description
I want to access a consul service that is behind an nginx API gateway (see nginx.conf snippet below) i.e. instead of acessing consul directly like this:
curl -v http://10.1.2.3:8500/v1/kv/x/y/z/?recurse=&wait=1800000ms
I want to access consul behind an nginx API gateway, like this:
curl -v http://10.1.2.3/foo/bar/consul/v1/kv/x/y/z/?recurse=&wait=1800000ms
This works fine with curl creating the HTTP requests but the
api.Config
does not have any provision for adding a prefix path to requests. When I try the followingconsul fails because it tries to resolve
10.1.2.3/foo%2Fbar%2Fconsul
as a hostnameerror:
Get "http://10.1.2.3%2Faugtera%2Fconfdb/v1/kv/x/y/z/?recurse=&wait=1800000ms": dial tcp: lookup 10.1.2.3/foo/bar/consul: no such host
Use Case(s)
using consul that is behind an API gateway
Sample diffs
I don't have permission to push a branch for a PR. Here is a diff
nginx.conf snippet