Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
haproxytechblog / blog20190321-01.conf
Last active August 19, 2019 21:38
HAProxy vs NGINX: An Up-to-date Comparison
http {
server {
listen 80;
location / {
proxy_pass http://my_upstream;
}
location /api/ {
proxy_pass http://api_servers;
}
@haproxytechblog
haproxytechblog / blog20190724-01.txt
Last active August 27, 2019 20:35
DNS for Service Discovery in HAProxy
_service._proto.name. TTL class SRV priority weight port target
@haproxytechblog
haproxytechblog / blog20190723-01.sh
Last active September 4, 2019 15:20
HAProxy Traffic Mirroring for Real-world Testing
$ sudo apt update
$ sudo apt install -y autoconf automake build-essential git libcurl4-openssl-dev libev-dev libpthread-stubs0-dev pkg-config
$ git clone https://github.com/haproxytech/spoa-mirror
$ cd spoa-mirror
$ ./scripts/bootstrap
$ ./configure
$ make all
$ sudo cp ./src/spoa-mirror /usr/local/bin/
@haproxytechblog
haproxytechblog / blog20190705-01.sh
Last active September 17, 2019 15:30
Dissecting the HAProxy Kubernetes Ingress Controller
kubectl apply -f https://raw.githubusercontent.com/haproxytech/kubernetes-ingress/master/deploy/haproxy-ingress.yaml
@haproxytechblog
haproxytechblog / blog20171011-01.cfg
Last active October 11, 2019 16:20
HAProxy SSL Termination
frontend www.mysite.com
bind 10.0.0.3:80
bind 10.0.0.3:443 ssl crt /etc/ssl/certs/mysite.pem
default_backend web_servers
@haproxytechblog
haproxytechblog / blog20121029-01.cfg
Last active October 16, 2019 15:42
HAProxy Log Customization
defaults
log-format "<format-string>"
@haproxytechblog
haproxytechblog / blog20191129-01.cfg
Last active November 29, 2019 17:08
HAProxy 2.1: Supercharged Performance and a Cleaner Codebase
global
h1-case-adjust content-length Content-Length
@haproxytechblog
haproxytechblog / video-yammer-20190120-01.cfg
Created January 20, 2020 19:48
HAProxyConf 2019 - Yammer
defaults
mode {protocol}
balance {balanceMode}
timeout client {clTO}
timeout connect {cTO}
timeout server {sTO}
timeout http-keep-alive {kaTO}
listen ::{service}-{servicePort}
acl down nbsrv(hc-{servicePort}) lt 1
@haproxytechblog
haproxytechblog / video-thredup-20200120-01.cfg
Last active January 20, 2020 21:12
HAProxyConf 2019 - thredUP
backend cart_service
server blue-cart-service cart-blue.ec2.tup.internal:8025 check weight 0 backup
server green-cart-service cart-green.ec2.tup.internal:8025 check weight 100
@haproxytechblog
haproxytechblog / blog20200121-01.cfg
Created January 21, 2020 18:15
Building Blocks of a Modern Proxy
stats socket /var/run/haproxy.sock mode 600 expose-fd listeners level user