解决nginx下加载eot|otf|ttf|woff|svg等404 错误问题

location / {

root html;

index index.html index.htm;

}

        location ~* \.(eot|ttf|woff|woff2|svg|wsv)$ {

            add_header Access-Control-Allow-Origin *;

            add_header Access-Control-Allow-Headers X-Requested-With;

            add_header Access-Control-Allow-Methods GET,POST,OPTIONS;

        }

解决特殊类型文件问题(arcgis的wsv文件)

[esri.views.3d.environment.Stars] loadBrightStarCatalogue Unable to load http://localhost/arcgis_js_v411_api/arcgis_js_api/library/4.11/esri/views/3d/environment/resources/stars.wsv status: 404

在nginx配置文件mine.types添加类型

binary/octet-stream                                 wsv;

并设置wsv文件跨域访问,上面有跨域配置

不知道类型怎么办?找一个能够访问的链接查看http请求。没有链接建议使用application/octet-stream试一试

发表评论

邮箱地址不会被公开。 必填项已用*标注