'CloudFront Issue loading text, instead showing html
I am using CloudFront with the following policies.
Cache Policy: Disable
Origin Request Policy:
cookies_config {
cookie_behavior = "all"
}
headers_config {
header_behavior = "whitelist"
headers {
items = ["Host", "Accept-language]
}
}
query_strings_config {
query_string_behavior = "all"
}
But the problem is that in one of the section of website showing HTML instead of text/design.
Expected Result
Actual Result
Solution 1:[1]
The issue was in the origin request policy of CloudFront, missing some header which I wasn't able to find specific, so putting header as AllViwers, it is showing the expected result.
Origin Request Policy
cookies_config {
cookie_behavior = "all"
}
headers_config {
header_behavior = "allViewer"
}
query_strings_config {
query_string_behavior = "all"
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


