Website showing html code instead of web page on Chrome

bug

#1

I have an Angular 4 app , that i deployed it using docker on aws ec2 machine. I’m using CloudFlare to manage my DNS.
The problem is on Chrome when i try to refresh the page, instead of showing me the web page , it returns me the html code of the index.If i access the page directly via the IPV4 from the machine the app works fine.
On Firefox/Safari everything works as expecting.


#2

Incorrect mime type?

URL?


#3

I found out that the Cloudflare on Chrome was adding a header : x-content-type-options: nosniff that was causing the issue.
I deactivated it and now it’s working also in Chrome.


#4

Where did you disable that? AFAIK that header shouldnt come from Cloudflare.


#5

In Crypto , in HTTP Strict Transfer Security(HSTS) , there is an options for No-Sniff Header which was enabled.


#6

Related issue -> "x-content-type-options: nosniff" only for CSS and JS


closed #7

This topic was automatically closed after 31 days. New replies are no longer allowed.