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
Spiivak
SpiivakOP2w ago
have already tried using Configure NGINX with the Public IP
Cold
Cold2w ago
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
Spiivak
SpiivakOP2w ago
its for sure showing in the url the correct api for the backend
Cold
Cold2w ago
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?
Spiivak
SpiivakOP2w ago
yes sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d {IP}
Cold
Cold2w ago
Not too sure what further help I can provide here. Might be worth asking #ask-ai - I normally work with Caddy
Yetzederixx
Yetzederixx2w ago
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 imo
RaphaelEtim
RaphaelEtim2w ago
Hi @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.
Want results from more Discord servers?
Add your server