Skip to content

Commit c7c895c

Browse files
committed
fix(router): avoid consistently hashing on empty string
1 parent 34cce83 commit c7c895c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

router/image/templates/nginx.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ http {
158158
{{ $useSSL := or (getv "/deis/router/sslCert") "false" }}
159159
{{ $domains := ls "/deis/domains" }}
160160
{{ $certs := ls "/deis/certs" }}
161+
## workaround for nginx hashing empty string bug http://trac.nginx.org/nginx/ticket/765
162+
{{ if exists "/deis/router/affinityArg" }}
163+
set_random $prng 0 99;
164+
set_if_empty $arg_{{ getv "/deis/router/affinityArg" }} $prng;
165+
{{ end }}
161166
## start service definitions for each application
162167
{{ range $app := lsdir "/deis/services" }}
163168
{{ $upstreams := printf "/deis/services/%s/*" $app}}

0 commit comments

Comments
 (0)