· Updated

Doing a (301) redirect with HAPROXY without cache

  • infrastructure

This article was written in 2019. Tools and versions have moved on since then, so some content may be outdated.

Docker

Example configuration for haproxy.cfg

acl example-1 hdr(host) -i example-1.com
acl example-2 hdr(host) -i example-2.com

http-request redirect location https://www.%[hdr(host)]%[url]\r\nCache-Control:\ no-cache,\ no-store,\ max-age=0,\ must-revalidate code 301 if example-1 or example-2

← All posts