Skip to content

Instantly share code, notes, and snippets.

@vqiu
Forked from mdmsua/default.ctmpl
Created June 29, 2018 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vqiu/2245329c52feaa1c8b6f0f8472132e2c to your computer and use it in GitHub Desktop.
Save vqiu/2245329c52feaa1c8b6f0f8472132e2c 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