title: Nginx does not serve Angular hosted in a docker image
body: <p>This question has been asked a million times and we've tried nearly every solution we could find to try and resolve it.</p>
  <p>We are serving an Angular application, hosted inside an Docker image (NGINX Alpine image) within the default location, /usr/share/nginx/html/*, via a mapping 80:7021.</p>
  <p>On our Linux box, we hooked a container to serve a bunch of images, one of them being this Angular image.</p>
  <p>The Angular image is build with --prod base-href=&quot;/v2/&quot; as the final URL that should be serving the app has a /v2/ location hooked up in NGINX on the Linux machine.</p>
  <p>Inside our default configuration for NGINX on the Linux box, we have a location /v2/ hooked up and a proxy_pass to http://localhost:7021</p>
  <p>Also inside the NGINX on the Linux box we set the mime.types accordingly, to ensure that JS/CSS is served correct.</p>
  <p>However, the JS/CSS files are not served. By default, if NGINX cannot find a file, it serves the standard index.html file instead, resulting in the dreaded &quot;resource served as text/html&quot; error.</p>
  <p>We have tried every possible scenario to resolve this so I'm turning here in hopes that someone has seen this behavior not being resolved and can supply a resolution other than mime.types and location /.css.</p>
  <p>Again, an reiteration of the two scenarios we have.</p>
  <p>1.) A Docker image, based on NGINX Alpine</p>
  <p>This image contains a <code>--prod --base-href=&quot;/v2/&quot;</code> built version of our Angular application.</p>
  <p>The application files are copied to <code>/usr/share/nginx/html/*</code>.</p>
  <p>2.) Hostbox</p>
  <p>The host box is running Ubuntu 18.04 distro and has NGINX 1.14.2 and Docker 19.03.6.</p>
  <p>The host box has a container set up to run a set of images, including the Angular image, discussed above. The host box, in NGINX has a /location set up for the Angular application at /v2/*, meaning:</p>
  <p><a href="https://www.awesomewebsite/v2/%7Bangular%7D" rel="nofollow noreferrer">https://www.awesomewebsite/v2/{angular}</a>, thus the reason why we built the account with a base-href of /v2/.</p>
  <p>This is standard practice as far as we're aware and things should just work. Yet it doesn't. We've exhausted our Google searching. What can we try next?</p>