I have created an AWS EC2 instance with Node and Mongodb installed in it. This is backend code. Also I have frontend react code which is deployed in cloudways, so to connect this with the backend code, I have given the ipaddress of ec2 instance in the frontend (React).But when I try to connect these both(Eg. Login page(Frontend react code) - when i submit the login details it has to hit backend (mongodb)). It does not the even hit backend url rather throws this error in browser console.
The error is:
Mixed Content: The page at 'https://www.mywebsite.com/signup/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://(ec2-ip-address)/api/apiname'. This request has been blocked; the content must be served over HTTPS.
But When I tried to hit the backend(EC2 IpAddress) in postman app. I can able to save or retrieve data from mongodb which is installed in Ec2 Instance.