I get an error when trying to access the fonts on the server from the local machine.

Font from origin 'https: //##########' has been blocked by the Resource Sharing policy. Origin 'https: // localhost: 8080' is therefore not allowed access.

In .htaccess added:

<IfModule mod_headers.c> <FilesMatch "\.(ttf|otf|woff|woff2)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> 

This did not solve the problem. In the header, Access-Control-Allow-Origin: * is not added.

 HTTP/1.1 200 OK Server: nginx Date: Sat, 23 Apr 2016 10:43:01 GMT Content-Length: 142072 Connection: keep-alive Last-Modified: Sat, 23 Apr 2016 09:11:31 GMT ETag: "1856f6-22af8-53123544a33d2" Accept-Ranges: bytes 

What else could be the problem?

Added 1

The problem of adding an Access-Control-Allow-Origin to the header: *, decided to include the mod_headers module. But the error still remained.

Current response header:

 HTTP/1.1 200 OK Server: nginx Date: Sat, 23 Apr 2016 11:19:03 GMT Content-Length: 142072 Connection: keep-alive Last-Modified: Sat, 23 Apr 2016 09:11:31 GMT ETag: "1856f6-22af8-53123544a33d2" Accept-Ranges: bytes Access-Control-Allow-Origin: * 
  • one
    Is mod_headers enabled? - Urmuz Tagizade
  • @Urmuz Tagizade was indeed turned off. But the problem with No 'Access-Control-Allow-Origin' somehow remained. - Arentheal
  • After powering on, did you restart Apache? - Urmuz Tagizade
  • @Urmuz Tagizade, yes, the Access-Control-Allow-Origin response header: * is added, but for some reason the error remained. - Arentheal
  • Answered ... Check - Urmuz Tagizade

1 answer 1

Check if you have the mod_headers module enabled.

Next, add to .htaccess:

 Header add Access-Control-Allow-Origin "*"