Last active
November 5, 2020 17:56
-
-
Save haproxytechblog/22928ddc024b036ea8ab33865f8a2ee6 to your computer and use it in GitHub Desktop.
Announcing HAProxy 2.3
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
log-forward syslog-lb | |
bind :::7514 # Listen on TCP IPv4/IPv6 | |
dgram-bind :::7514 # Listen on UDP IPv4/IPv6 | |
# load balance messages on 4 udp syslog servers | |
log 10.1.0.2:10001 format rfc5424 sample 1:4 local0 info | |
log 10.1.0.3:10002 format rfc5424 sample 2:4 local0 info | |
log 10.1.0.4:10003 format rfc5424 sample 3:4 local0 info | |
log 10.1.0.5:10004 format rfc5424 sample 4:4 local0 info |
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 "show stat domain dns" |socat tcp-connect:127.0.0.1:9999 - | |
# id, send_error, valid, update, cname, cname_error, any_err, nx, timeout, refused, other, invalid, too_big, truncated, outdated, | |
nameserver1, 0, 20, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, |
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 stats | |
bind :8404 | |
stats enable | |
stats uri / | |
stats refresh 10s | |
stats show-modules | |
no log |
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
# The old replace-path directive only replaces the path | |
# Add /foo to the end of the path | |
# /a/b/c?x=y --> /a/b/c/foo?x=y | |
http-request replace-path ([^?]+)(\?{1}[^?]+)? \1/foo |
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
# Strip off the query string | |
# /a/b/c?x=y --> /a/b/c/foo | |
http-request replace-pathq ([^?]+)(\?{1}[^?]+)? \1/foo | |
# Add x=y to the query string | |
# /a/b/c?x=y --> /a/b/c/foo?x=y&foo=bar | |
http-request replace-pathq ([^?]+)(\?{1}[^?]+)? \1/foo\2&foo=bar |
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
# The old set-path directive | |
# Prepend /foo to the path | |
# /a/b/c?x=y --> /foo/a/b/c?x=y | |
http-request set-path /foo%[path] | |
# The new set-pathq directive | |
# Strip off the query string | |
# /a/b/c?x=y --> /foo/a/b/c | |
http-request set-pathq /foo%[path] |
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
http-request set-header x-forwarded-proto %[ssl_fc,iif(https,http)] |
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
http-after-response set-header x-cache %[res.cache_hit,iif(Hit,Miss)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment