Port 8500 not reachable - what is it?

I am trying to setup some basic Nomad service and I get following error:

Template failed: health.service(global-redis-check|passing): Get "http://127.0.0.1:8500/v1/health/service/global-redis-check?passing=1&stale=&wait=60000ms": dial tcp 127.0.0.1:8500: connect: connection refused

Where is this port 8500 coming from?

job "nginx" {
  datacenters = ["aws"]

  group "nginx" {
    count = 1

    network {
      port "http" {
        static = 8080
      }
    }

    service {
      name = "nginx"
      port = "http"
      provider = "nomad"
    }

    task "nginx" {
      driver = "docker"

      config {
        image = "nginx"

        ports = ["http"]

        volumes = [
          "local:/etc/nginx/conf.d",
        ]
      }

      template {
        data = <<EOF
upstream backend {
{{ range service "global-redis-check" }}
  server {{ .Address }}:{{ .Port }};
{{ else }}server 127.0.0.1:65535; # force a 502
{{ end }}
}

server {
   listen 8080;

   location / {
      proxy_pass http://backend;
   }
}
EOF

        destination   = "local/load-balancer.conf"
        change_mode   = "signal"
        change_signal = "SIGHUP"
      }
    }
  }
}

Hi @vladaman, port 8500 is the default HTTP port for Consul. Since you have provider = "nomad", it looks like you intend to use Nomad’s native service discovery instead of Consul. In that case, in the template block you’ll need to use range nomadService instead of where you have range service. The later is only for Consul services.