Created
November 19, 2013 15:11
-
-
Save kurap/7546782 to your computer and use it in GitHub Desktop.
クロスドメインでWEBフォントを使用する場合の設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IE, Firefoxの最新版だとクロスドメイン制約のため、S3からWEBフォントをダウンロードしようとするとエラーとなる。 | |
>> 対処方法 | |
bucket の [properties] - [Permissions] の [add cors configuration]に設定を追加 | |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> #### ←ここに許可するドメインを追加 *はワイルドカードなので全許可 | |
<AllowedMethod>GET</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>Authorization</AllowedHeader> | |
</CORSRule> | |
</CORSConfiguration> | |
NGINXの設定でヘッダー追加をする場合 | |
location ~* \.(eot|ttf|woff)$ { | |
add_header Access-Control-Allow-Origin *; | |
} | |
source:http://serverfault.com/questions/162429/how-do-i-add-access-control-allow-origin-in-nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment