Cross-domain CORS policy preventing custom font from loading

I have a multisite setup using subdomains and I’m getting the dreaded CORS policy 404 when trying to load custom fonts. I created a file under the appropriate domain inside nginx-includes and tried:

location ~* \.(eot|ttf|woff)$ {
  add_header Access-Control-Allow-Origin '*';
}

also tried

location ~* \.(eot|ttf|woff)$ {
  include h5bp/directive-only/cross-domain-insecure.conf;
  access_log off;
  add_header Cache-Control "max-age=2592000";
}

Each time after making changes, I ran:

ansible-playbook server.yml -e env=staging --tags nginx-includes

I’m still having the problem. I can SSH into the server and everything looks like it should, but I can’t get rid of the issue.

1 Like

Did you manage to solve this? I seem to be having the same issue.

@jpedigo1 @richardwilis did you find a solution for this? I am in the same boat.

No, never did figure it out. I have since abandoned the multisite setup and, for that matter, am no longer using the roots stack for WP development.