update slides and code

This commit is contained in:
Jérémy Lecour 2022-11-12 12:24:35 +01:00 committed by Jérémy Lecour
parent d10bca31e6
commit f18a06df41
3 changed files with 8 additions and 5 deletions

View File

@ -111,8 +111,6 @@ frontend external
bind 0.0.0.0:80,:::80
bind 0.0.0.0:443,:::443 ssl strict-sni alpn h2,http/1.1 crt /etc/haproxy/ssl
capture request header Host len 32
option forwardfor
errorfiles boost-default-errors
@ -123,8 +121,10 @@ frontend external
# Remove a possible x-forwarded-for header already present
http-request del-header x-forwarded-for if { req.hdr(x-forwarded-for) -m found }
# store the Host header in lowercase, to speedup ACL later
# Store the Host header in lowercase, to speedup ACL later
http-request set-var(req.hdr_host) req.hdr(host),lower
# Capture host header in logs
http-request capture var(req.hdr_host) len 32
# Is the request coming for the server itself (stats…)
acl self var(req.hdr_host) -m str my-hostname my-hostname.domain.tld
@ -220,13 +220,16 @@ backend goto_internal
frontend internal
bind /run/haproxy-frontend-default.sock user root mode 666 accept-proxy
capture request header Host len 32
option forwardfor
# Check URL (used by Varnish)
monitor-uri /haproxycheck
# Store the Host header in lowercase, to speedup ACL later
http-request set-var(req.hdr_host) req.hdr(host),lower
# Capture host header in logs
http-request capture var(req.hdr_host) len 32
acl varnish_from hdr(X-Varnish) -m found
acl forwarded_proto hdr(x-forwarded-proto) -m found

Binary file not shown.

Binary file not shown.