question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strict MIME type error causes white page (nginx + cloudflare)

See original GitHub issue

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn’t find similar issue

🛡️ Security Policy

📝 Describe your problem

When navigating to status.example.com, I see a completely white page with this error in the console:

Chrome: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

Safari: Loading module from “https://status.example.com/assets/index.56b35390.js” was blocked because of a disallowed MIME type (“text/html”). & The stylesheet https://status.example.com/assets/index.43631e1a.css was not loaded because its MIME type, “text/html”, is not “text/css”.

Opening [IP]:3001/status/example, the page does load correctly on both browsers.

I’m using cloudflare and nginx with the following config:

server {
    listen 80;
    listen [::]:80;
    server_name status.example.com;

    location / {
        proxy_pass http://127.0.0.1:3001/status/tsealink;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_set_header   Host $host;
    }

}

Anyone who can help me? Thanks!

🐻 Uptime-Kuma Version

1.18.5

💻 Operating System and Arch

Debian 11

🌐 Browser

Chrome, Safari, Firefox

🐋 Docker Version

No response

🟩 NodeJS Version

14.18.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
jojost1commented, Oct 13, 2022

You’re great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nginx run java webapp as non root using cloudflare ssl
And the page is blank because no stylesheet or javascript is loaded :(. ... MIME type ('text/html') is not executable, and strict MIME...
Read more >
Refused to apply style from <URL> because its MIME type ...
Refused to apply style from <URL> because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is...
Read more >
Stylesheet not loaded because of MIME type - Stack Overflow
Show activity on this post. One of the main reasons for the issue is the CSS file, which it is trying to load,...
Read more >
WordPress with Nginx and Cloudflare - Server Fault
I suggest you disable CloudFlare, install Let's Encrypt, and then re-enable CF with SSL set to Full (Strict). – Michael Hampton. Dec 16,...
Read more >
Node.js + Nginx + HTTPS + Cloudflare Server setup ( Google ...
Recently I'm working on my web programming homework, which is a online-chatroom with express/socket.io as backend.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found