title: docker nginx not loading css styles
body: <p>When uploading static files to my server using Nginx as the web server my css, javascript, and google fonts are not working as they do when testing the site on localhost.</p>
  <p>I'm running Nginx in a docker container using the base image.<br />
  Dockerfile</p>
  <pre><code>FROM nginx
  COPY example.com.conf /etc/nginx/nginx.conf
  COPY build /etc/nginx/html/
  </code></pre>
  <p>nginx.conf</p>
  <pre><code>user nginx;
  
  events {
    worker_connections  4096;  ## Default: 1024
  }
  
  http {
    server {
      listen 80;
      listen [::]:80;
  
      server_name example.com;
  
      include /etc/nginx/mime.types;
      root /etc/nginx/html;
      index index.html;
  
      location ~ \.css {
        add_header  Content-Type    text/css;
      }
      location ~ \.js {
        add_header  Content-Type    application/x-javascript;
      }
  
      location / {
        try_files $uri /index.html =404;
      }
    }
  }
  </code></pre>
  <p>Can someone tell me whats wrong with my conf?</p>
  <p>Also when viewed on Chrome the console logs this <code>Resource interpreted as Stylesheet but transferred with MIME type text/plain</code></p>
  <p>Some other SO post I looked at:<br />
  <a href="https://stackoverflow.com/questions/10075304/nginx-fails-to-load-css-files">SO post</a><br />
  <a href="https://stackoverflow.com/questions/45716128/css-and-images-not-recognized-by-nginx-resource-interpreted-as-stylesheet-but-t">SO post</a></p>