Reverse-proxying behind HAProxy does not work

Hello Grafana community, I have recently attempted to reverse-proxy my Grafana instance behind HAProxy. Problem is, when I attempt to load Grafana on the reverse-proxied address it doesn’t work, as in it gives me an error like this:

Logging out and back in doesn’t change anything and I cannot access any of the menus without them showing no content except for an error, the only exception being for the one to log out.
Accessing Grafana via its IP address and standard port (3000) works fine.
Grafana config:

instance_name = example grafana

domain =

cookie_samesite = strict

allow_sign_up = false
allow_org_create = false

enabled = true
hide_version = true

HAProxy config (partially cut out):

    maxconn     100000
    log local0 info
    user        haproxy
    chroot      /usr/share/haproxy
    pidfile     /run/
    ssl-default-bind-options ssl-min-ver TLSv1.2

frontend website
    bind :80
    bind :443           ssl     crt /etc/ssl/site/merge.pem
    mode                http
    log                 global
    option              httplog
    option              dontlognull
    option              http_proxy
    option forwardfor   except
    timeout             client  30s
    http-request redirect scheme https unless { ssl_fc }
    acl api     path_beg        -i /api /metrics
    acl grafana hdr_beg(host)   -i grafana
    acl pxmx    hdr_beg(host)   -i proxmox

    use_backend api             if api
    use_backend grafana         if grafana
    use_backend pxmx            if pxmx
    default_backend             nginx

backend grafana
    log         global
    mode        http
    balance     roundrobin
    timeout     connect 5s
    timeout     server  30s
    timeout     queue   30s
    server      grafana      check

Thanks in advance!

Alright, I figured out that a request to /api/dashboards/home is returning 404 from the reverse-proxy, when from the requests to the IP it works fine…
I doubt it’s HAProxy but it’s possible.