nginx + angular + minio 配置求助

2019-12-02 21:30:55 +08:00
 HangoX

我用 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.
2065 次点击
所在节点    程序员
3 条回复
lpd0155
2019-12-02 21:36:02 +08:00
不是 MIME 报错吗,改一下
HangoX
2019-12-02 22:05:14 +08:00
@lpd0155 道理我都懂,问题是我不知道怎么改😂
lpd0155
2019-12-02 22:25:03 +08:00
Include /path/to/mime.types

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/625254

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX