docker – NGINX shows raw CSS code instead of rendering it

I’m trying to deploy my flask application on my VM, on docker containers while using NGINX to serve static files. But when I spin up everything and go to my app in the browser I only get the raw CSS code I am trying to host, NGINX doesn’t render it.

Here is a screenshot of what Im seeing

Here is my nginx config

    listen       80;
    listen  [::]:80;
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  main.css;
        include  /etc/nginx/mime.types;
    }

And here is my docker-compose.yml

services:
  app:
    build: .
    ports:
      - 5000

  nginx:
    build:
      context: ./nginx
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app
    ports:
      - "80:80"

Read more here: Source link