Say I have the following nginx config:
{{ range service "my-service" }}
server {{ .Address }}:{{ .Port }};
{{ else }}server 127.0.0.1:65535; # force a 502
{{ end }}
Port seems to return whatever port is registered for the service with Consul - but what if I want to connect to the port associated with the Consul Connect sidecar? In some cases, that is the only port associated with the service, and Port
in those contexts returns 0
.