Public Repository

Last pushed: a year ago
Short Description
Load-balancing of micro-services with nginx, where the nginx config is generated by consul_template.
Full Description

Simple example for a consul template, where the service name in consul is "com-cern-spring-test-generic-service-5".

upstream generic-service5-instances {
least_conn;
{{range service "com-cerny-spring-test-generic-service-5"}}server {{.Address}}:{{.Port}} max_fails=3 fail_timeout=60 weight=1;
{{else}}server 127.0.0.1:65535; # force a 502{{end}}
}

server {
listen {{env "GENERIC_SERVICE_5_PORT"}} default_server;

location / {
proxy_pass http://generic-service5-instances;
}
}

Docker Pull Command
Owner
cerny

Comments (0)