I'm having trouble matching some file extensions in my Nginx config. I'm running nginx/1.11.6 on Debian x64.
I have this config: (located in server { } block)
location ~* \.(ttf|ttc|otf|eot|woff|woff2|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}
It should allow access to all these types of resources from any domain. But it doesn't work for woff
and woff2
.
I have tried this:
location ~* \.woff2$ {
return 403;
}
But not even this does anything.
Result from CURL test looks like this:
curl -s -I -X GET https://cdn.xxxxx.xxx/font.woff2
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 21 Nov 2016 22:41:27 GMT
Content-Type: font/woff2
Content-Length: 14552
Last-Modified: Mon, 21 Nov 2016 22:31:42 GMT
Connection: keep-alive
ETag: "583375ce-38d8"
Expires: Wed, 21 Dec 2016 22:41:27 GMT
Cache-Control: max-age=2592000
Cache-Control: public
Accept-Ranges: bytes
Any idea where I might be wrong?