I deployed an Odoo instance on ECS + FARGATE as a service, which is assigned to a target group.
On ALB I have a listener on port 443 with ACM that redirects the traffic on that target group.
The connection is working, I can reach the Odoo service from the ALB.
The problem is, Odoo can respond with 3xx codes, and I can see the url changing on the browser address bar. But instead of loading the new page, I get an error.
If resend the request directly with this same url, the one resulting from the redirect, the page loads as expected.
If I connect to the service directly, without ALB, it works fine.
From what I could understand, the ALB doesn't manage the 3xx response codes from the target group, so it gives an error.
What can i do to resolve this redirect problem?
EDIT: Problem solved, here is what i tried: I tried setting the listener on HTTP instead of HTTPS, and it worked fine. After that, i reconfigured the listener on HTTPS, and added an HTTP listener which returned a fixed response. Tried to click an url of the server which returns a 3xx code, and instead of an error i got the fixed response. In practice, the server behind the ALB listens on port 80, so when it issues a redirect, it does so on HTTP. The ALB receives in as HTTP, but wasn't listening. It was configured only on HTTPS. Hence the error. I resolved configuring two listeners:
- an HTTPS listener which forwards traffic towards the target group
- an HTTP listener which redirects to HTTPS