Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 单性粘滞期_Iis_Ubuntu 16.04_Load Balancing_Haproxy - Fatal编程技术网

Iis 单性粘滞期

Iis 单性粘滞期,iis,ubuntu-16.04,load-balancing,haproxy,Iis,Ubuntu 16.04,Load Balancing,Haproxy,我正在尝试使用Haproxy 1.6.3 2015/12/25和粘性会话。 我根据做了所有事情,但不幸的是,检查客户端浏览器时,我发现没有添加cookies(平衡器必须在第一个请求后的响应中返回cookies,但它不返回任何内容,并且在没有发生任何事情时工作(没有cookies))。其他一切都很好,但饼干不行。我已附上我的haproxy.cfg: global log /dev/haproxy/log local0 log /dev/haproxy/log local1 notice

我正在尝试使用Haproxy 1.6.3 2015/12/25和粘性会话。 我根据做了所有事情,但不幸的是,检查客户端浏览器时,我发现没有添加cookies(平衡器必须在第一个请求后的响应中返回cookies,但它不返回任何内容,并且在没有发生任何事情时工作(没有cookies))。其他一切都很好,但饼干不行。我已附上我的haproxy.cfg:

global
  log /dev/haproxy/log local0
  log /dev/haproxy/log local1 notice
  chroot /var/lib/haproxy
  stats socket /run/haproxy/admin.sock mode 660 level admin
  stats timeout 30s
  user haproxy
  group haproxy 
  daemon

defaults
  log global
  mode http
  option httplog
  option dontlognull
  timeout connect 5000ms
  timeout client 50000ms
  timeout server 50000ms

  stats enable
  stats auth user:pass
  stats uri /haproxy_stats

  option httpchk HEAD / HTTP/1.0
  option redispatch

  balance roundrobin

frontend frontend_http
  bind *:80
  option forwardfor
  default_backend backend_http

backend backend_http
  option prefer-last-server
  cookie mycookies insert indirect nocache
  server server1 196.168.0.125:80 check cookie s1
  server server2 196.168.0.126:80 check cookie s2

此外,我的服务器(服务器1、服务器2)部署在IIS上,而平衡器部署在Ubuntu 16.04 LTS上。更改后端配置:

backend backend_http
option prefer-last-server
cookie mycookies insert indirect nocache
server server1 196.168.0.125:80 check cookie server1
server server2 196.168.0.126:80 check cookie server2


上帝保佑你:)
backend backend_http
option prefer-last-server
cookie mycookies insert indirect nocache
server s1 196.168.0.125:80 check cookie s1
server s2 196.168.0.126:80 check cookie s2