CSS not loading due to wrong MIME type

1. The problem I’m having:

CSS is not loading on my fileshelter site due to wrong MIME type. Everything works normally otherwise.

2. Error messages and/or full log output:

GET
https://vps6.dedyn.io/files/share-create
[HTTP/2 200 OK 62ms]

InstallTrigger is deprecated and will be removed in the future. constants.js:50:14
GET
https://vps6.dedyn.io/files/share-create?wtd=l68MDjWh2oXjyu4b&request=style&page=1
[HTTP/2 200 OK 153ms]

Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Some cookies are misusing the recommended “SameSite“ attribute 3
GET
https://vps6.dedyn.io/files/resources/themes/bootstrap/5/main.css
[HTTP/2 200 OK 62ms]

GET
https://vps6.dedyn.io/files/resources/moz-transitions.css
[HTTP/2 200 OK 64ms]

GET
https://vps6.dedyn.io/files/css/fileshelter.css
[HTTP/2 200 OK 60ms]

GET
https://vps6.dedyn.io/files/resources/font-awesome/css/font-awesome.min.css
[HTTP/2 200 OK 87ms]

The stylesheet https://vps6.dedyn.io/files/css/fileshelter.css was not loaded because its MIME type, “text/html”, is not “text/css”. share-create
The stylesheet https://vps6.dedyn.io/files/resources/themes/bootstrap/5/main.css was not loaded because its MIME type, “text/html”, is not “text/css”. share-create
The stylesheet https://vps6.dedyn.io/files/resources/moz-transitions.css was not loaded because its MIME type, “text/html”, is not “text/css”. share-create
The stylesheet https://vps6.dedyn.io/files/resources/font-awesome/css/font-awesome.min.css was not loaded because its MIME type, “text/html”, is not “text/css”. share-create
GET
https://vps6.dedyn.io/files/resources/themes/bootstrap/5/bootstrap.bundle.min.js
[HTTP/2 200 OK 54ms]

The script from “https://vps6.dedyn.io/files/resources/themes/bootstrap/5/bootstrap.bundle.min.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
share-create
Uncaught SyntaxError: expected expression, got '<'
bootstrap.bundle.min.js:1
GET
https://vps6.dedyn.io/favicon.ico
[HTTP/2 200 OK 0ms]

3. Caddy version:

v2.6.4

4. How I installed and ran Caddy:

a. System environment:

Installed from epel repo on AlmaLinux 9.2 x86_64

b. Command:

systemctl start caddy

c. Service/unit/compose file:

Using the default systemd unit file.

d. My complete Caddy config:

https://vps6.dedyn.io {
    redir /jellyfin /jellyfin/

    handle /jellyfin/* {
        reverse_proxy 10.8.0.1:8096
    }

    redir /files /files/

    handle /files/* {
        reverse_proxy localhost:5091
    }

    handle {
        respond "You must've lost your way, wanderer!"
    }
}

Since you’re proxying to serve those files, this isn’t a problem with Caddy. Whatever that service you’re using is, is to blame.

It’s probably not designed for serving files for a website, but only meant for file downloads.

It seems to work just fine over http, and also in a subdomain over Caddy. This however is a DDNS site, so I have to do subfolder. The settings of this app has an option to enable reverse proxy support, and this is happening with that on.

Okay, then that app is missing a feature to support being run under a base path. You’ll need to ask them to add support for that.

That said, are you sure you can’t use a subdomain? Try files.vps6.dedyn.io. Or use DuckDNS instead, which definitely has subdomain support.

1 Like

It does have that option, which is turned on. But maybe it’s buggy, I’ll open an issue on their GitHub.

It doesn’t work.
(Edit: Looks like it does. I just needed to create a separate CNAME entry.)

Thanks, I’ll check it out.