global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4500 user haproxy group haproxy daemon defaults mode tcp log global retries 8 timeout connect 10s timeout server 10s timeout client 10s frontend 0 bind *:25565 mode tcp acl test hdr(host) -i test.mydomain.com use_backend 0 if test backend 0 mode tcp server node0 22.28.29.28:25585 check 你好, […]
我正在使用以下configuration来终止SSL,以便我可以检查请求,执行URL重写,ACL等,然后将SSLstream量转发回到我的后端服务器。 但是,我不能粘性工作。 当我只使用“mode tcp”并且直接转发tcp路由时,我可以变得粘性工作,但是一旦我开始在前端终止SSL,sticky就停止工作。 这是我的configuration: frontend https-forward bind *:443 ssl crt /etc/haproxy/certs.d/combo.pem option http-server-close option forwardfor reqadd X-Forwarded-Proto:\ https reqadd X-Forwarded-Port:\ 443 capture request header Referrer len 64 capture request header Content-Length len 10 capture request header User-Agent len 64 # set HTTP Strict Transport Security (HTST) header rspadd Strict-Transport-Security:\ max-age=15768000 # some ACLs and […]
如果我所有的液滴都来自同一个数据中心,是否有可能在云中进行这种负载均衡? 或者我需要某种物理设备来做这种第4层负载平衡? 如下所示: http : //blog.haproxy.com/2011/07/29/layer-4-load-balancing-direct-server-return-mode/ 我喜欢负载平衡器只是分配的想法,然后服务器直接向客户端回复请求。 这可能没有物理硬件,但像haproxy软件?
看起来,在HTTPS连接上configurationHAProxy进行主机名路由时,至关重要的是包含一个tcp-request inspect-delay指令来“让HAProxy有机会查看连接”。 有没有办法让NGINX一样,或者我应该开始打包,并将我的整个服务器移动到HAProxy? (作为参考,这个问题来自我此前expression的误解) 编辑 迈克尔在评论中说: 他似乎希望从客户端的握手尝试中“嗅探”SNI,而不实际终止TLS连接,以便作出低层的连接代理决定,并盲目地将有效载荷传送到后续的terminal机,以终止TLS,因为某些原因,他不希望代理上的TLS证书和密钥,或代理完成TLS – 只需嗅探SNI,并使用从其内容派生的规则build立内部TCP连接。 理由是我需要后端应用程序中的证书和密钥(有些需要这个或那个原因),所以我必须提供给他们。 不得不在代理中设置它们本质上是维护工作的两倍,并且有可能出现错误。 如果我不能保持对代理证书的访问,就会使我的架构变得更容易,并减less错误的机会。
我正在使用由在CentOS主机上运行的Docker容器组成的基础架构平台。 通过docker工具来缩放多个容器 领事服务发现。 服务注册的注册人 HAProxy作为负载平衡器 用于每次添加/删除容器时生成haproxyconfiguration的Consul-template。 每次我们更新我们的构build,新的容器被生成,旧的容器被删除。 问题是容器被即时移除,而不考虑容器所服务的现有请求。 理想情况下,我应该有一个信号来标记在维护或排水模式的容器,以便现有的连接可以服务,然后优雅地从haproxy从物理上去除。 有没有人遇到过这个问题,或通过容器完成类似的自动缩放工作stream程。
有可能有像HTTP一样的ftp反向代理 例 client >> proxy >> real server 我曾尝试使用haproxy 但是最后,ftp服务器的真实ip不会像http反向代理一样暴露 我用这个与haproxy listen FTP :21, :10000-10250 mode tcp server ftp01 realserverip:21 check port 21
我有一个HaProxy设置,其中每个haproxy服务器将stream量路由到多个应用程序服务器。 正常httpstream量的路由基于请求url的散列。 现在我想创build一些规则来允许某些pipe理请求被路由到特定的应用程序服务器。 那就是我有应用程序服务器“node06 – node15”。 我希望能够请求node06.mydomain.com/my-admin-request并将其路由到正确的应用程序服务器。 我不能通过DNS来做到这一点。 所有请求都通过一个暴露的IP地址进入集群。 所以我做了一个haproxyconfiguration,做我想要的: frontend www-http bind :80 reqadd X-Forwarded-Proto:\ http acl node06 hdr_beg(host) -i node06. use_backend node06-status if node06 acl node07 hdr_beg(host) -i node07. use_backend node07-status if node07 # … and many more such nodes … default_backend application-backend # This is the application back end. # Route request […]
我有添加新服务器时dynamic更新的haproxy.cfg ,但是在添加新服务器的时候,服务器可能仍然会出现。 (服务器最初不健康)。 由于这个原因,当新服务器引入时,我收到了50x错误。 我几乎没有控制这个时间,但我有一些控制在服务器和后端设置的参数。 有没有办法,我可以在服务器或后端设置参数,使一个新的服务器将不会采取stream量,直到它是健康的? 这是我目前的后端的一个例子: backend my_backend balance roundrobin mode http option httpchk GET /actuator/health timeout check 5s server 10_48_111_20_31623 10.48.111.20:31623 check inter 10s fall 4 server 10_48_111_55_31430 10.48.111.55:31430 check inter 10s fall 4 server 10_48_111_55_31479 10.48.111.55:31479 check inter 10s fall 4
我可能已经迷失在这个主题的大量文档,但我想configuration我的HAProxy进程发送PROXY协议标头,如http://www.haproxy.org/download/1.8/doc/ proxy-protocol.txt 。 这是因为我不得不将PROXY协议的支持写入到C ++服务器(为了能够访问客户端IP /端口),并且我想testing我的代码是否正确地处理了PROXY头文件的parsing。 这是我最小的configuration文件: global maxconn 4096 defaults log global mode http retries 3 option redispatch maxconn 2000 timeout connect 5000 timeout client 50000 timeout server 50000 frontend TestServerTest bind 10.6.186.24:54781 mode tcp default_backend TestServernodes backend TestServernodes mode tcp # Note there is no 'check' after the below line unlike the others […]
我正在尝试使用HAProxy设置传递代理。 版本: – HA-Proxy版本1.7.5 2017/04/03 我有两个urlabc.com/foo和abc.com/bar,我希望它被redirect到我的后端服务器服务请求为10.0.0.1/xyz/ 例如,如果我的请求是abc.com/foo/login,所以这个请求应该作为10.0.0.1:7003/xyz/login到我的后端服务器,但前端应该只显示abc.com/foo/login 。 我尝试使用下面 "http-request redirect code 301 location http://%[hdr(host)]%[url,regsub(^/foo/,/bar/,)] if { path_beg /foo }" 但是它将URL更改为abc.com/xyz 我一直在使用nginx,下面是我的configuration相同。 server { listen 8443; underscores_in_headers on; location /Recharge { proxy_pass http://backend/RetailerApp; proxy_read_timeout 15; } location /Gateway { proxy_pass http://backend/RetailerApp; proxy_read_timeout 15; } } upstream backend_preprod { server 10.5.214.237:7005; server 10.5.214.237:7004; }