0

I am trying to serve all my static assets via nginx. The javascript I have is loading in fine however the css keeps coming in with Content-Type:text/plain. This is causing the browser to not use the css file. Here is my nginx.conf:

events {
    worker_connections  1024;
}

http {
    server {
        listen       80;

        location / {
            include /etc/nginx/mime.types;
            root /opt/app/public;
        }
    }
}

The include:

<link rel="stylesheet" href="/css/main.css">

Most of the stack overflow threads recommend including the mime types which I already have and it did not fix my issue. Any suggestions?

1 Answer 1

1
server {
    root /www/data;

    location / {
    }

    location /images/ {
    }

    location ~ \.(mp3|mp4) {
        root /www/media;
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.