skip to Main Content

I have hosted my node.js app on AWS EC2.

I don’t have a domain name for my nodejs app. I am running it on Public IPv4 address 54.242.85.178.

I have a domain for my front end and its running on https so when https and http comes I am getting the following error:

Mixed Content: The page at ‘https://www.wixten.com/query/622c64b4a12ed5002313daf5’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://54.242.85.178/answersapi/622c64b4a12ed5002313daf5’. This request has been blocked; the content must be served over HTTPS.

2

Answers


  1. The error says it all – you can’t mix https and http. You have to go through your source code and eliminate all http urls and substitute them for proper https urls.

    Login or Signup to reply.
  2. Based on the error, your frontend is making HTTPS calls to an HTTP endpoint (on the ip 54.242.85.178), hence you have that error. I am guessing you’re using ajax to make that call.

    For a quick fix, you can update your frontend to make HTTP calls to your backend, This will sort out this issue, however this is HIGHLY NOT recommended but it will help you understand the issue better.

    Ideally, you have to add an SSL certificate on your backend as well, then you can make HTTPS calls to it from your frontend.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search