use of nginx server_name
You need to add a host entry of mylocalserver in the host file against 127.0.0.1, like 127.0.0.1 mylocalserver.  
For /consul, there should be a /consul endpoint in your code to serve your request.


As per your configuration, your http://localhost will be served because you have set proxypass for "/"(all). It will send all requests to the application/server and will be served.