COR error when using cloudfront and rails

I’m trying to configure my Ruby on Rails applications to use cloud front. CSS and JS seem to work fine. But I’m getting COR errors for font assets

Caddyfile {
  encode zstd gzip
  header / {
    Strict-Transport-Security "max-age=31536000"
  @assets {
    path /assets/*
  header @assets Access-Control-Allow-Origin "*"
  header @assets Access-Control-Allow-METHODS “GET, POST”
  reverse_proxy unix//home/deploy/apps/rails-application/shared/tmp/sockets/rails-application-puma.sock

error when fetching a font

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource```

### config/environments/production.rb
  config.public_file_server.headers = {
    'Access-Control-Allow-Origin' => '*'