我用 angular 写了个程序,然后托管在 minio 上,其中用了路由功能,nginx 我就不知道怎么配置了 以下是我失败的配置,主要是静态文件不知道怎么配置
server {
listen 80;
server_name ci-monitor.cc-mobile.cn
# To allow special characters in headers
ignore_invalid_headers off;
# Allow any size file to be uploaded.
# Set to a value such as 1000m; to restrict file size to a specific value
client_max_body_size 1000m;
# To disable buffering
proxy_buffering off;
location ~* \.(jpg|jpeg|gif|png|ico|css|js|pdf|txt|svg|map|json|ttf|woff|woff2)$ {
proxy_pass http://192.168.44.229:9000/website/ci-monitor/$1/$2;
}
location / {
rewrite ^/$ /website/ci-monitor/index.html break;
# proxy_set_header Host $http_host;
# rewrite ^ /index.html break;
proxy_pass http://192.168.44.229:9000/website/ci-monitor/index.html;
}
}
我这个配置会导致这个问题
Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
runtime-es2015.edb2fcf2778e7bf1d426.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
polyfills-es2015.55a4aa6ad9b7515939f7.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.