nginx 部署web项目 出现mime type 为plan的问题

276 阅读1分钟

报错信息

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec

mime.types位置

image.png

在nginx.conf 中添加如下配置

    include mime.types;
    default_type application/octet-stream;

位置如图所示

image.png

切记要清除浏览器缓存 and 重启nginx。