Angularjs Angular1 Nginx资源解释为样式表,但使用MIME类型text/html传输

Angularjs Angular1 Nginx资源解释为样式表,但使用MIME类型text/html传输,angularjs,nginx,Angularjs,Nginx,这件事让我伤心。 我已经使用nginx在数字海洋水滴上部署了angular 1应用程序。 我可以访问该网站,但我的资产以html文件的形式加载。 这是我的nginx配置 server { listen 80; listen [::]:80; root /home/me/app; index index.html; server_name example.com; location / { try_files $uri $uri/ /in

这件事让我伤心。 我已经使用nginx在数字海洋水滴上部署了angular 1应用程序。 我可以访问该网站,但我的资产以html文件的形式加载。 这是我的nginx配置

server {
    listen 80;
    listen [::]:80;

    root /home/me/app;
    index index.html;

    server_name example.com;
    location / {
    try_files $uri $uri/ /index.html;
    }
}
应用程序结构:

Project
    app
       index.html
       styles
          app.css
       libs
          angular
             angular.js
          jquery
我经历了这一切,所以我找不到答案,但没有成功。 以下是我尝试过的一些东西

  • 使用
    样式
  • 我检查了nginx mime类型文件,一切看起来都正常
  • 删除了链接和脚本标记上的所有
    类型
    属性
  • 我在网上找到了很多随机的东西,到目前为止还没有任何效果
  • 更新: 运行
    curl-v后
    这是输出

      Connected to example.com (12.23.12.33) port 80 (#0)  
      GET /libs/assets/animate.css/animate.css HTTP/1.1
      Host: example.com  
      User-Agent: curl/7.47.0
      Accept: */*
      HTTP/1.1 200 OK
      Server: nginx/1.10.3 (Ubuntu)
      Date: Fri, 08 Sep 2017 08:59:47 GMT
      Content-Type: text/html
      Content-Length: 3777
      Last-Modified: Fri, 08 Sep 2017 07:56:35 GMT
      Connection: keep-alive
      ETag: "59b24d33-ec1"
      Accept-Ranges: bytes
    

    它基本上返回index.html文件的内容

    我可以通过在服务器块中插入内容类型来修复它

    location ~ \.css {
        add_header  Content-Type    text/css;
     }
    
    location ~ \.js {
        add_header  Content-Type    application/x-javascript;
     }
    

    响应带有2个内容类型标题,但现在对我来说很有用。

    尝试添加
    include mime.types我不太清楚。请在哪里以及如何使用?在您的服务器块中,nginx configI刚刚完成了。没有工作。你能在你的css上执行
    curl-v
    并发布日志的输出吗