Skip to content

Commit

Permalink
nginx: Fix accidental load-balancing between IPv4 and IPv6.
Browse files Browse the repository at this point in the history
Apparently, our nginx configuration's use of "localhost", combined
with the default in modern Linux of having localhost resolve to both
the IPv4 and IPv6 addresses on a given machine, resulted in `nginx`
load-balancing requests to a given Zulip server between the IPv4 and
IPv6 addresses.  This, in turn, resulted in irrelevant 502 errors
problems every few minutes on the /events endpoints for some clients.

Disabling IPv6 on the server resolved the problem, as does simply
spelling localhost as 127.0.0.1 for the `nginx` upstreams that we
declare for proxying to non-Django services on localhost.
  • Loading branch information
timabbott committed May 22, 2018
1 parent e420766 commit c843276
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions puppet/zulip/files/nginx/zulip-include-frontend/upstreams
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ upstream django {
}

upstream tornado {
server localhost:9993;
server 127.0.0.1:9993;
keepalive 10000;
}

upstream localhost_sso {
server localhost:8888;
server 127.0.0.1:8888;
}

upstream camo {
server localhost:9292;
server 127.0.0.1:9292;
}

0 comments on commit c843276

Please sign in to comment.