Haproxy custom error page does not always work

Hello
In order to have customized error pages, I added some config into haproxy:
http-errors defaulterrorpages
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http

frontend fe_dmz
bind *:80
bind [::]:80
bind *:443 ssl crt /etc/haproxy/tls-certs/ alpn h2,http/1.1
bind [::]:443 ssl crt /etc/haproxy/tls-certs/ alpn h2,http/1.1
mode http
option httplog

    errorfiles defaulterrorpages


There is a backedn returns 403, but sometimes the customized page shows, sometimes the default 403 page appears.
Then for some reason we modified our 403 page, haproxy returns 3 versions of 403 page now: the default one, the page before modification and the page after modification.
It seems that there is a cache somewhere? Is it a default behavior of Haproxy?
Thanks

If a backend returns a 403 error, that will be passed as is, always. The errofile directive matters only for errors that haproxy generates.

Unless we are talking about the backend error page, this happens when haproxy was not properly reloaded/restart/stopped and you end up running with some older haproxy instances in parallel that sometimes get requests.

To solve this stop haproxy, killall haproxy and when you have confirmed with ps that no haproxy processes are running anymore, then you start haproxy again.