Magento 2 – The resource from pub/ directory was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

When you deploy the source code to the live server, you may see the issue

The resource from pub/ directory was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)…

You can solve it by the following ways

  1. Remove all files from var/ folder by using this command rm -rf var/*
  2. Check for .htaccess in pub/static. If not exists, take a file from a fresh setup.
  3. Run the following commands php bin/magento setup:static-content:deploy -f php bin/magento indexer:reindex php bin/magento cache:clean

Hope it helps you solve the problem 🙂

Revisions

No comments yet.

Leave a Reply