Consul with Nginx, not using docker
I have done this in the past using https://github.com/hashicorp/consul-template.

What consul-template does it generate a configuration file (for nginx) based on a certain template you provide. And the values that it fills into this template are coming from the configuration stored in consul.

Each time your micro-services register themselves in consul and need to be addressed in the nginx configuration file, consul-template does it for you by changing the file and sending a SIGHUP (kill -1) to the nginx process that makes it reload nginx configuration.

The repository for consule-template contains an example of managing nginx https://github.com/hashicorp/consul-template/blob/master/examples/nginx.md



If you are using Nginx Plus, which is the commercial version of Nginx. Then it has support for Consul built-in. https://www.nginx.com/blog/service-discovery-with-nginx-plus-and-consul/ and https://www.nginx.com/blog/service-discovery-nginx-plus-srv-records-consul-dns/ go into depth on this subject.