HAProxy是一个款基于Linux的开源高可用的负载均衡与反向代理工具,与Nginx大同小异。
搜遍了全网,几乎都是基于Linux平台。Windows平台的要么就是多年前的旧版本,要么就是不兼容OpenSSL,无法进行HTTPS请求,要么就是花钱买但又觉得不一定适用。
索性花了小半天时间研究了下,成功build出基于windows的haproxy2.2.4(最新版是2.2.5,担心最新版的稳定性,所以选了前面一个小版本)。
global
nbproc 1
daemon
ssl-default-bind-options force-tlsv12
defaults
timeout connect 90000ms
timeout client 90000ms
timeout server 90000ms
frontend HaProxy
bind *:80
redirect scheme https if !{ ssl_fc }
bind *:443
mode http
default_backend AlphaServer
backend OmniServer
mode http
balance roundrobin
server AlphaServer localhost:10086
listen admin_status
bind *:1188
mode http
stats refresh 30s
stats uri /
stats auth haproxy:haproxy
stats admin if TRUE
关于配置文件的含义,就不具体解释了,朋友们可以网上查一查。
这个应该很简单,也不一一赘述了。
测试的时候忘了截图,有点干,朋友将就将就。
在Windows进下build 高可用负载均衡与反向代理神器:HAProxy
原文:https://www.cnblogs.com/shy-huang/p/13973382.html