HAproxy

HAProxy redirect based on path?

北慕城南 提交于 2019-12-06 07:59:36
I need to redirect certain paths to https - frontend secured The reason for this is that i want certain parts of my web application to only be allowed to run over https. I've figured out how to redirect all traffic by changing my HAproxy conf like this: frontend unsecured *:80 #timeout client 86400000 #redirect prefix http://domain.com code 301 mode http timeout client 120s But how can i configure it to only redirect certain sub-folder on my domain? What i would like is to redirect only the following URLs: http://domain.com/info http://domain.com/echo http://domain.com/broadcast http://domain

Haproxy tuning for performance?

为君一笑 提交于 2019-12-06 07:49:11
问题 We are trying to find the best tuning options for haproxy for get and post request that come from a client (not users browsing the web type of deal). Running a jmeter test with 30k threads that consists of 5 calls to the servers, 1 user reg, and a few update calls. These push json data though the pipeline. Here us our current config for haproxy global log /dev/log local0 #notice maxconn 14000 tune.bufsize 128000 user netcom group netcom pidfile /tmp/haproxy.pid daemon nbproc 7 #debug #quiet

HAproxy SSL Segfault with 1.5-dev17

ε祈祈猫儿з 提交于 2019-12-06 04:05:29
Getting a segfault when trying to enable ssl on 1.5-dev17 Ubuntu Server 12.04 Tried almost every variation I could think of with private key and CA bundle concatenated and used as a single crt, also tried split crt with private key and ca-file as CA bundle. /etc/haproxy/haproxy.cfg global maxconn 4096 daemon defaults mode http contimeout 5000 clitimeout 50000 srvtimeout 50000 option forwardfor retries 3 option redispatch option http-server-close frontend http bind *:80 reqadd X-Forwarded-Proto:\ http default_backend unicorn frontend https bind *:443 ssl crt /path/to/private.key ca-file /path

Haproxy负载均衡与高可用

风流意气都作罢 提交于 2019-12-06 01:43:44
HAPROXY简介 HAProxy提供高可用性、负载均衡以及基于TCP和HTTP应用的代理,支持虚拟主机,它是免费、快速并且可靠的一种负载均衡解决方案。HAProxy特别适用于那些负载特大的web站点,这些站点通常又需要会话保持或七层处理。HAProxy运行在当前的硬件上,完全可以支持数以万计的并发连接。并且它的运行模式使得它可以很简单安全的整合进您当前的架构中,同时可以保护你的web服务器不被暴露到网络上。 2、HAProxy的特点是: 1、HAProxy支持虚拟主机。 2、HAProxy的优点能够补充Nginx的一些缺点,比如支持Session的保持,Cookie的引导;同时支持通过获取指定的url来检测后端服务器的状态。 3、HAProxy跟LVS类似,本身就只是一款负载均衡软件;单纯从效率上来讲HAProxy会比Nginx有更出色的负载均衡速度,在并发处理上也是优于Nginx的。 4、HAProxy支持TCP协议的负载均衡转发,可以对MySQL读进行负载均衡,对后端的MySQL节点进行检测和负载均衡,可以用LVS+Keepalived对MySQL主从做负载均衡。 5、HAProxy负载均衡策略非常多,HAProxy的负载均衡算法现在具体有如下8种:   ① roundrobin,表示简单的轮询,这个不多说,这个是负载均衡基本都具备的;   ② static-rr

How do I configure Tomcat and HAProxy to work with the WebSocket Framework Atmosphere?

Deadly 提交于 2019-12-06 01:41:08
I have a Java application running on Tomcat7, which uses the Atmosphere Framework . Atmosphere is a Websocket Framework. I used a sample application from the Atmosphere Sample Chat . My problem is that I did not get the connectors as well as the proper configuration for my Websocket Atmosphere application running. The questions I have are: How do I have to configure my HAProxy? How do I have to configure my Tomcat server? How do I have to configure Tomcat for APR and for the NIO connector? Do I have to change something in my app (i.e., my web.xml)? How do I have to fix the errors below? This

API gateway for WebSocket

拈花ヽ惹草 提交于 2019-12-06 00:06:29
I need a API gateway for my websocket application. Analyse and identify unusual requests from certain IP Quotas and Rate Limiting Statistics Free or commercial Solid performance The sub-protocol of my WebSocket is WAMP, so I am afraid there is no existing product to do the job. I intend to develop one and suppose it will work in this way: There is a proxy (NGINX or HAProxy) installed between my client application and my websocket server The proxy duplicates the request/response to another app, which I call monitor The monitor app analyses the flow and control the proxy to limit/block certain

搭建DHProxy服务器

这一生的挚爱 提交于 2019-12-05 23:44:44
集群与存储 HAProxy简介 HAProxy简介 • 它是免费、快速并且可靠的一种解决方案 • 适用于那些负载特大的 web 站点 , 这些站点通常又需要会话保持或七层处理 • 提供高可用性、负载均衡以及基于 TCP 和 HTTP 应用的代理 衡量负责均衡器性能的因素 • Session rate 会话率 – 每秒钟产生的会话数 • Session concurrency 并发会话数 – 服务器处理会话的时间越长 , 并发会话数越多 • Data rate 数据速率 – 以 MB/s 或 Mbps 衡量 – 大的对象导致并发会话数增加 – 高会话数、高数据速率要求更多的内存 HAProxy 工作模式 • mode http – 客户端请求被深度分析后再发往服务器 • mode tcp – 客户端与服务器之间建立会话 , 不检查第七层信息 • mode health – 仅做健康状态检查 , 已经不建议使用 HTTP协议解析 HTTP 解析 • 当 HAProxy 运行在 HTTP 模式下 ,HTTP 请求 (Request) 和响应 (Response) 均被完全分析和索引 , 这样便于创建恰当的匹配规则 • 理解 HTTP 请求和响应 , 对于更好的创建匹配规则至关重要 HTTP 事务模型 • HTTP 协议是事务驱动的 • 每个请求 (Request) 仅能对应一个响应

Error response from daemon: (config) includes invalid characters for a local volume name

爱⌒轻易说出口 提交于 2019-12-05 21:15:26
I have a running node server which listens on 3 different ports. I have three different subdomains of a url pointing to port 80 of the server on which node is running/listening. What I am trying to do is proxy pass a request from a sub-domain to its respective port using haproxy . My node server is dockerized with the ports exposed on the host. I can hit them individually using the server's IP address on their port so they seem to be running fine. My haproxy will also be running inside a docker container. I am completely new to haproxy though I am fairly confident with dockers. I wrote my

使用kubeadm搭建高可用k8s v1.16.3集群

一笑奈何 提交于 2019-12-05 19:39:28
目录 1、部署环境说明 2、集群架构及部署准备工作 2.1、集群架构说明 2.2、修改hosts及hostname 2.3、其他准备 3、部署keepalived 3.1、安装 3.2、配置 3.3、启动和检查 4、部署haproxy 4.1、安装 4.2、配置 4.3、启动和检查 5、安装docker 5.1、安装 5.2、配置 5.3、启动 6、安装kubeadm,kubelet和kubectl 6.1、添加阿里云k8s的yum源 6.2、安装 6.3、配置kubectl自动补全 7、安装master 7.1、创建kubeadm配置文件 7.2、初始化master节点 7.3、按照提示配置环境变量 7.4、查看集群状态 8、安装集群网络 8.1、获取yaml 8.2、安装 8.3、检查 9、其他节点加入集群 9.1、master加入集群 9.2、node加入集群 9.3、集群后续扩容 10、集群缩容 11、安装dashboard 11.1、部署dashboard 11.2、创建service account并绑定默认cluster-admin管理员集群角色 11.3、使用token登录到dashboard界面 1、部署环境说明 本文通过kubeadm搭建一个高可用的k8s集群,kubeadm可以帮助我们快速的搭建k8s集群

Match haproxy path using path_reg

痞子三分冷 提交于 2019-12-05 18:20:44
I'm trying to match urls like: /rivers/1, /rivers/2adsfs, /rivers/sdfd2d with: acl rivers_show path_reg ^/rivers/\w+/? But that does seem to work. Anyone know why? HAproxy's regex does not include \w as a character class. Keep in mind regex is one of the worst performing ACL matches. You may want to look into use something like this instead, although its its not exactly the same. acl path_beg /rivers/ You can use the below the regex to match the give acl rivers_show path_reg -i ^\/rivers\/[^\.]* 来源: https://stackoverflow.com/questions/12254963/match-haproxy-path-using-path-reg