Way to bypass CORS check

I'm trying to use pihole (dockerized, behind traefik) with homer which is a dashboard, which accesses the pihole api to get stats. But the CORS is preventing this call. I added CORS headers in traefik, but now the api.php returns a Failed CORS: homer_fqdn vs ip,pihole_fqdn. While using with nginx, I bypassed this with a custom fastcgi_param HTTP_ORIGIN "";, but cant seem to figure out for lighttpd 15-fastcgi-php.conf.

What is the right way to get CORS working?