0

My API was working locally, but when I deployed it on Vercel, it stopped working because my API uses the 'HTTP' method, and 'HTTPS' is required. The error message indicated that the page was loaded over HTTPS, but the XMLHttpRequest endpoint was insecure and requested 'HTTP'. As a result, the request was blocked and the content must be served over HTTPS.

*Notice: I'm not the owner of this API

Error: "Mixed Content: The page at 'https://my-app.vercel.app/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://my-api.com'. This request has been blocked; the content must be served over HTTPS."

How to fix it? Thank you for any help.

  • I used CloudFlare with "Always use Https" but it didn't work for my domain: myapp.supervps.ga
  • How can I continue to access without using "HTTPS" or another workaround?
Wongjn
  • 8,544
  • 2
  • 8
  • 24
Rizone
  • 1
  • 1
  • If you just need it to work for you, you can disable the mixed content check in your browser then it will load. Details for Chrome here: https://stackoverflow.com/questions/18321032/how-to-get-chrome-to-allow-mixed-content – Daniel Black May 03 '23 at 15:22
  • If it needs to work for everyone, then unfortunately I don't think there is a workaround, you will need to install an SSL certificate on the API server and implement. – Daniel Black May 03 '23 at 15:23
  • I tried it, it doesn't seem to be blocked by the browser but because the Vercel server doesn't allow this. Thank you. – Rizone May 03 '23 at 15:52
  • Is this a client side request or server side (serverless)? Vercel has no say about what happens client side so it shouldn't matter – mousetail May 03 '23 at 18:19

0 Answers0