Updated:

MIME types

Content-Type tells the browser what it received: HTML, CSS, JavaScript, JSON, image, XML, or a downloadable file.

If the type is wrong, a page can look broken even when the HTTP status is 200.

Check Content-Type

curl -kI https://getsrv.app/
curl -kI https://getsrv.app/sitemap-index.xml

For a concrete asset:

ASSET="$(find /var/www/getsrv.app/assets -maxdepth 1 -type f | head -n 1 | sed 's#^/var/www/getsrv.app##')"
curl -kI "https://getsrv.app$ASSET"

Common types

FileContent-Type
.htmltext/html
.csstext/css
.jsapplication/javascript
.jsonapplication/json
.xmltext/xml or application/xml
.svgimage/svg+xml
.pngimage/png
.jpg, .jpegimage/jpeg
.webpimage/webp
.icoimage/x-icon
.txttext/plain
.pdfapplication/pdf
.zipapplication/zip
.wasmapplication/wasm
.woff2font/woff2

HTML

Expected:

curl -kI https://getsrv.app/ | grep -i content-type
content-type: text/html

If HTML is served as text/plain, the browser may show source text instead of rendering the page.

CSS

CSS should be served as:

content-type: text/css

If CSS is served as HTML, the asset path is usually broken and the server is returning fallback HTML or a 404 page.

JavaScript

JavaScript is usually served as:

content-type: application/javascript

If JS is served as text/html, the browser may refuse to execute it because of MIME mismatch.

JSON

For JSON:

content-type: application/json

If JSON is served as text/html, the client may be receiving an HTML error page instead of data.

SVG

For SVG:

content-type: image/svg+xml

SVG is an active format, so CSP and X-Content-Type-Options: nosniff matter.

Why nosniff matters

Header:

X-Content-Type-Options: nosniff

prevents browsers from guessing file types. This is good for security, but it requires correct MIME types.

If nosniff is enabled and JS/CSS are served with the wrong Content-Type, the browser may refuse to use them.

Where MIME types are configured in Nginx

Nginx usually includes:

include /etc/nginx/mime.types;

Check:

sudo grep -RIn "mime.types\\|default_type" /etc/nginx/nginx.conf /etc/nginx/conf.d /etc/nginx/sites-enabled

Typical fallback:

default_type application/octet-stream;

Post-deploy check

curl -kI https://getsrv.app/ | grep -i content-type
curl -kI https://getsrv.app/sitemap-index.xml | grep -i content-type

ASSET="$(find /var/www/getsrv.app/assets -maxdepth 1 -type f | head -n 1 | sed 's#^/var/www/getsrv.app##')"
curl -kI "https://getsrv.app$ASSET" | grep -i content-type

Common problems

CSS does not apply

Check:

curl -kI https://getsrv.app/assets/example.css

If the response is text/html, the URL does not point to CSS.

JavaScript does not run

Check the JS file Content-Type and browser Console.

Typical signal:

Refused to execute script because its MIME type is text/html

Sitemap does not parse

Check:

curl -kI https://getsrv.app/sitemap-index.xml

For sitemap files, text/xml or application/xml is acceptable.

Minimal rule

For a static site, do not check only status. Check the pair:

HTTP status + Content-Type

200 text/html for a page is good.
200 text/html for JS is bad.
404 text/html for a missing page is normal when it is a controlled 404.