Load balancer returning MIME type mismatch

0

Environment:

  • a domain on Route 53 pointing to cloudfront distribution
  • the distribution have an ALB as origin and cache all the requests
  • the ALB receives the requests and forward to 2 ECS services (depending on the url path)
    • one listener to redirect all http access to https
    • one https listener with rules for each service
  • ECS have 2 services, appA (Nuxt3) and appB (Nuxt2)

What I want: I want all the access through 'de/' routes being forward to appA and all access through 'en/' being forward to appB.

What I tried: I tried to create a rule in my ALB sending requests from 'de/' to appA and the default access to appB. It works in terms of access the content, but appA start to failing in various components giving me the same error message: "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". The application is fine, when I run locally works ok. When I try the opposite (rule for 'en/' -> appB and default access -> appA) then appB starts with the same error so I doesnt seen like a app problem.

Any ideas how to solve this?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions