แบบอักษรที่ให้บริการผ่าน Cloudfront ใช้งานไม่ได้ใน Firefox เนื่องจาก "ปัญหา URI หรือการเข้าถึงข้ามไซต์ไม่ถูกต้อง" เพื่อแก้ไขปัญหานี้ ฉันเข้าใจว่าฉันต้องตั้งค่าส่วนหัว "Access-Control-Allow-Origin" เป็นไวด์การ์ดหรือโดเมนต้นทาง
ปัญหาที่ฉันมีคือ Cloudfront ดูเหมือนจะไม่ยอมรับส่วนหัวจากต้นทาง
ตัวอย่างเช่น ต่อไปนี้เป็นรายการส่วนหัวที่ฉันได้รับเมื่อฉัน ping เซิร์ฟเวอร์ของฉันสำหรับแบบอักษร:
curl -I -s "https://mysite.com/wp-content/themes/my-theme/includes/fonts/ProximaNova-Reg-webfont.ttf"
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 29 Jan 2014 16:03:03 GMT
Content-Type: application/x-font-ttf
Content-Length: 44992
Last-Modified: Tue, 28 Jan 2014 22:21:41 GMT
Connection: keep-alive
ETag: "52e82d75-afc0"
Expires: Thu, 29 Jan 2015 16:03:03 GMT
Cache-Control: max-age=31536000
Access-Control-Allow-Origin: https://mysite.com
Access-Control-Allow-Methods: GET
Access-Control-Max-Age: 3600
Accept-Ranges: bytes
ทุกอย่างดูดีกับคำตอบนี้ อย่างไรก็ตาม เมื่อฉัน ping Cloudfront สำหรับทรัพยากรเดียวกัน ฉันจะได้รับ:
curl -I -s "https://ds6dj5kp03o39.cloudfront.net/wp-content/themes/my-theme/includes/fonts/ProximaNova-Reg-webfont.ttf"
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 44992
Connection: keep-alive
Date: Wed, 29 Jan 2014 16:22:30 GMT
Server: Apache/2.2.16 (Debian) mod_ssl/2.2.16 OpenSSL/0.9.8o
Last-Modified: Wed, 22 Jan 2014 02:44:45 GMT
ETag: "5d633-afc0-4f0861b87a140"
Accept-Ranges: bytes
Cache-Control: max-age=3600
Expires: Wed, 29 Jan 2014 17:22:30 GMT
X-Cache: Miss from cloudfront
Via: 1.1 850e11212c3f83bfb138469e9b3b7718.cloudfront.net (CloudFront)
X-Amz-Cf-Id: M4qkj9FwjdAUW91U4WeZzxEI0m7vOmiQvryS55WwoeU5Ks11IC71ig==
ดูเหมือนว่าส่วนหัวดั้งเดิมทั้งหมดจะถูกละเว้นไปโดยสิ้นเชิง คำถามของฉันคือ ฉันจะทำให้ Cloudfront ยอมรับส่วนหัวเนื้อหาของฉันได้อย่างไร โดยเฉพาะส่วนหัว "Access-Control-Allow-Origin" ที่สำคัญ
ขอบคุณสำหรับความช่วยเหลือ!