This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ haproxy -vv | grep "Prometheus exporter" | |
Built with the Prometheus exporter as a service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -X PUT \ | |
-–user admin:password \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"name": "test", | |
"mode": "http", | |
"http-check": { | |
"type": "expect", | |
"match": "status", | |
"pattern": "200,201,300-310" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo "experimental-mode on; add server be_app/server10 10.0.1.5:80 check" |\ | |
socat stdio tcp4-connect:127.0.0.1:9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frontend myfrontend | |
option http-buffer-request | |
acl log4shell url,url_dec -i -m reg (?:\${[^}]{0,4}\${|\${(?:jndi|ctx)) | |
acl log4shell req.hdrs -i -m reg (?:\${[^}]{0,4}\${|\${(?:jndi|ctx)) | |
acl log4shell_form req.body,url_dec -i -m reg (?:\${[^}]{0,4}\${|\${(?:jndi|ctx)) | |
http-request deny if log4shell | |
http-request deny if { req.fhdr(content-type) -m str application/x-www-form-urlencoded } log4shell_form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ socat stdio tcp4-connect:127.0.0.1:9999 | |
prompt | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo dataplaneapi \ | |
--host 127.0.0.1 \ | |
--port 5555 \ | |
--haproxy-bin /usr/sbin/haproxy \ | |
--config-file /etc/haproxy/haproxy.cfg \ | |
--reload-delay 5 \ | |
--reload-cmd "service haproxy reload" \ | |
--restart-cmd "service haproxy restart" \ | |
--userlist haproxy-dataplaneapi \ | |
--transaction-dir /tmp/haproxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
run: web | |
name: web | |
annotations: | |
haproxy.org/check: "true" | |
haproxy.org/check-http: "/health" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: web-ingress | |
namespace: default | |
annotations: | |
haproxy.org/rate-limit-requests: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frontend myfrontend | |
http-request deny if { req.hdr_cnt(content-length) gt 1 } | |
http-response deny if { res.hdr_cnt(content-length) gt 1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |