HaProxy: errorfile : error opening file '/etc/haproxy/errors/404.http'

In learning the HAProxy and following “Serve Dynamic Custom Error Pages with HAProxy”, I’m getting the error when checking the haproxy.cfg:

aproxy:/etc/haproxy/errors # haproxy -c -f /etc/haproxy/haproxy.cfg
[NOTICE]   (25600) : haproxy version is 2.4.22
[NOTICE]   (25600) : path to executable is /usr/sbin/haproxy
[ALERT]    (25600) : parsing [/etc/haproxy/haproxy.cfg:37] : errorfile : error opening file '/etc/haproxy/errors/404.http'.
[ALERT]    (25600) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT]    (25600) : Fatal errors found in configuration.

and my permission are:

haproxy:/etc/haproxy/errors # ls -l
total 4
-rw-r--r-- 1 root root 364 Aug 15 20:58 404.http

what changes do I need to make to get this to work?

haproxy.cfg:

global
  log /dev/log daemon
  maxconn 32768
  chroot /var/lib/haproxy
  user haproxy
  group haproxy
  daemon
  stats socket /var/lib/haproxy/stats user haproxy group haproxy mode 0640 level operator
  tune.bufsize 32768
  tune.ssl.default-dh-param 2048
  ssl-default-bind-ciphers ALL:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH

defaults
  log     global
  mode    http
  option  log-health-checks
  option  log-separate-errors
  option  dontlog-normal
  option  dontlognull
  option  httplog
  option  socket-stats
  retries 3
  option  redispatch
  maxconn 1000
  timeout connect     5s
  timeout client     50s
  timeout server    450s
  timeout http-request 10s
  
listen stats
  bind 0.0.0.0:80
  stats enable
  stats uri     /monitor
  stats refresh 5s

http-errors httperrors
  errorfile 404 /etc/haproxy/errors/404.http

frontend kbbn7studio
  bind 127.0.0.1:80
  use_backend kbbn7studio if { hdr(host) -m dom kbbn7studio.kbbn-7.com }
  default_backend web_servers
  errorfiles httperrors
  http-response return status 404 default-errorfiles if { status 404 }
  
backend web_servers
  server kbbn7studio1 127.0.0.1:8000 check
  
backend kbbn7studio
  server kbbn7studio 10.30.60.12:443 check

Files that your program opens are relative to /var/lib/proxy, not relative to /.

I’m still missing something:

haproxy:/var/lib/haproxy/errors # haproxy -c -f /etc/haproxy/haproxy.cfg
[NOTICE]   (28344) : haproxy version is 2.4.22
[NOTICE]   (28344) : path to executable is /usr/sbin/haproxy
[ALERT]    (28344) : parsing [/etc/haproxy/haproxy.cfg:37] : errorfile : error opening file '/errors/404.http'.
[ALERT]    (28344) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT]    (28344) : Fatal errors found in configuration.
global
  log /dev/log daemon
  maxconn 32768
  chroot /var/lib/haproxy
http-errors httperrors
  errorfile 404 /errors/404.http

changed owner/group to:

haproxy:/var/lib/haproxy/errors # ls -l
total 4
-rw-r--r-- 1 haproxy haproxy 395 Aug 16 13:11 404.http

Question, I have SELinux as my default security module during installation and its currently set to permissive. I have not spent as of yes to learn how to configure SELinux, but could this be the reason why I’m getting this error on the .http files?