首次加载页面时不会加载字体

时间:2015-10-20 12:55:46

标签: css amazon-web-services fonts amazon-s3 amazon-ec2

当我的网站第一次加载时,没有加载字体。我收到以下错误

<CORSConfiguration>
    <CORSRule>
        <AllowedOrigin>https://www.locohop.com</AllowedOrigin>
        <AllowedOrigin>http://www.locohop.com</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>Content-*</AllowedHeader>
        <AllowedHeader>Host</AllowedHeader>
    </CORSRule>
</CORSConfiguration> 

我在谷歌上搜索了这个问题,stackoverflow

已经提出了这个问题

我按照上面提到的所有步骤操作,但字体无法正常工作。和 我正在使用AWS EC2实例

这是我的CORS配置

df <- read.table(text = "target birds    wolfs     
                        0       21         7  
                        0        8         4  
                        1        2         5 
                        1        2         4 
                        0        8         3 
                        1        1         12  
                        1       7          10 
                        1        1         9 ",header = TRUE)
myform <-NULL
myform <- target~1
dd<-NULL
for ( i in c('birds', 'wolfs')) { 

    myform <- update(myform,  as.formula(paste('~ birds +', i)))
    glm<-glm(myform,data=dat)
    dat$glm_predict_response <- ifelse(predict(glm,newdata=dat,   type="response")>.5, 1, 0)
    sum1<- sum(dat$glm_predict_response>0 & dat$target>0)
    sum2<- sum(dat$glm_predict_response<1 & dat$target<1)
    accuracy<- (sum1+sum2)/length(dat$glm_predict_response)
    print(myform)
    print(accuracy)

}

我不知道为什么会收到此错误?非常感谢您的帮助。

感谢。

1 个答案:

答案 0 :(得分:0)

您需要在.htacess

中创建一个CORS策略
Header add Access-Control-Allow-Origin "locohop.com"
相关问题