AWS Connection
hello there, im using aws to deploy my backend, and vercel for my frontend, for some reasons in localhost it will work to fetch data from my backend, but in my vercel cliney deploy i get this error
Mixed Content: The page at 'https://{url}/contacts' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://{url}/api/v1/contacts/details'. This request has been blocked; the content must be served over HTTPS.. i have tried using NGINX with my public IP but it still wont work. how to fix that?
8 Replies
have already tried using Configure NGINX with the Public IP
Could it be that your frontend on Vercel is trying to query your localhost API, and it not being SSL secured?
Most modern browsers to my knowledge will outright refuse this for good reason
its for sure showing in the url the correct api for the backend
It sounds like there might be something wrong with the SSL side of things
Did you generate a SSL certificate for your domain for the API?
yes
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d {IP}
Not too sure what further help I can provide here. Might be worth asking #ask-ai - I normally work with Caddy
I don't think this is a prisma problem. that said your second url is
http
and not https
and seems to be the issue imoHi @Spiivak
You need to setup https for your backend. One option is to use AWS Load Balancer with HTTPS. https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html
Create an HTTPS listener for your Application Load Balancer - Elast...
Learn about HTTPS listeners for your Application Load Balancer.