Nitrolabs / meteor-cdn

Load Meteor bundled resources from a CDN
55 stars 18 forks source link

Did not parse stylesheet at .... MIME Type #20

Closed flean closed 6 years ago

flean commented 6 years ago

I've set everything up but I must be doing something wrong. I've never setup a CDN and I've searched around for a solution but nothing seems to work.

I'm running on localhost for testing.

merged-stylesheets.css

generates this error Did not parse stylesheet at 'https://XXXXXXXXX.cloudfront.net/merged-stylesheets.css?hash=21a5c8f9e24c13ba8266fe68de625759d791b32a' because non CSS MIME types are not allowed in strict mode.

then I get a cascade of Refused to execute https://XXXXXXXXX.cloudfront.net/packages/meteor.js?hash=0504f43f667698535416b00eb44eb6f53161cb63 as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type.

Any help would be appreciated. Thanks

Cloudfront settings are:

General: Price Class: Use All Edge Locations AWS WAF Web ACL: None Alternate Domain Names: SSL Cert: Default Cloudfront Support HTTP Versions: HTTP1.1, HTTP1.0 (maybe i’ll change this to try and support 2) Default Root Object: Logging: Off Cooking Logging: Off Enable IPv6: Off

Origin Settings: Origin domain Name: myapp.mydomain.com Origin path: blank origin ID: myapp.mydomain.com Origin SSL protocols: TLS 1.2, 1.1, 1 Origin protocol policy: HTTPS only HTTP port: 80 HTTPS Port: 443 No custom headers

Behaviors: Path pattern: Default Origin: myapp.mydomain.com Viewer protocol: HTTPS ONLY Alllowed HTTP Methods: GET, HEAD Cached HTTP Methods: GET, HEAD Forward Headers: Whitelist Whitelist headers: Access-Control-Allow-Origin Content-Security-Policy Origin Strict-Transport-Security Object Caching: Use Origin Cache HEaders Min TTL: 0 Max TTL: 31536000 Default TTL: 86400 Forward Cookies: None Query String Forwarding + Caching: Forward all, cache based on all Smooth Streaming: No Restrict Viewer Access: No Compress Objects Automatically: Yes

flean commented 6 years ago

Works in production. Never mind