I didnt notice because locally the requests were going through fine because I was testing the app through http://localhost
This is all deployed on AWS ECS.
Front is end ReactJS btw, post request through axios to an api endpoint for a keras/tf model.
Yes, the easiest way to fix this issue to put your API server behind load balancr with HTTPS listenor, the error you get is because of http and https, as the frontend is listening on HTTPS and API on HTTP so browser throws errors as content is mixed.
The other option can be running frontend on HTTP but I'll not recommend this approach as it not secure.