Skip to content

Instantly share code, notes, and snippets.

@zeevallin
Created March 18, 2015 03:44
Show Gist options
  • Save zeevallin/1cbf339aac7a6abd6f3f to your computer and use it in GitHub Desktop.
Save zeevallin/1cbf339aac7a6abd6f3f to your computer and use it in GitHub Desktop.
gzip_types text/plain text/css text/javascript text/xml application/json application/x-javascript application/xml application/xml+rss;
{{ $cluster := getenv "CLUSTER" | printf "/clusters/%s" | getv | json }}{{ range $cluster.upstreams }}{{ $upstream := . | printf "/upstreams/%s" | getv | json }}{{ $servers := printf "/servers/%s/%s/*" (getenv "CLUSTER") . | gets }}
upstream @{{base .}} {
{{ range $servers }}server {{base .Key}} {{ range $key, $value := json .Value }}{{ $key }}={{ $value }}{{ end }};
{{ end }}server 0.0.0.0 fail_timeout=0;
}{{ end }}
server {
listen 80;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment