consistant worker for websocket

This commit is contained in:
Geno 2020-11-28 01:00:34 +01:00
parent 2243628c6e
commit 7276da8673
1 changed files with 1 additions and 0 deletions

View File

@ -65,6 +65,7 @@ http {
upstream socket_nodes { upstream socket_nodes {
# sticky only on commercial nginx # sticky only on commercial nginx
# sticky cookie srv_id expires=8h; # sticky cookie srv_id expires=8h;
hash $remote_addr consistent;
{% for n in range(osp_worker_count) %} {% for n in range(osp_worker_count) %}
{% if n != 0 or osp_worker_count == 1 %} {% if n != 0 or osp_worker_count == 1 %}
server 127.0.0.1:{{ osp_worker_start_port + n }}; server 127.0.0.1:{{ osp_worker_start_port + n }};