Skip to content

Instantly share code, notes, and snippets.

@mdmsua
Created April 29, 2016 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mdmsua/c3b7981723d958b983dc93625da653a5 to your computer and use it in GitHub Desktop.
Save mdmsua/c3b7981723d958b983dc93625da653a5 to your computer and use it in GitHub Desktop.
/etc/nginx/conf.d
server {
listen 80;
{{range services}}
{{if and (ne .Name "consul") (ne .Name "nginx")}}
{{range service .Name}}
location /{{.Name}}/v{{.ID}} {
rewrite /{{.Name}}/v(\d+)\.\d+\.\d+(.*) /{{.Name}}/v$1$2 break;
proxy_pass http://{{.Address}}:{{.Port}};
}
{{end}}
{{end}}
{{end}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment