-
-
Save vqiu/2245329c52feaa1c8b6f0f8472132e2c to your computer and use it in GitHub Desktop.
/etc/nginx/conf.d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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