Skip to content Skip to sidebar Skip to footer

Mixedcontent When I'm Loading Https Page Through Ajax, But Browser Still Thinks It's Http

After Installing SSL Cert on a web page, I had the problem where the page served with https would require http endpoint with ajax. I'm using restangular, and I changed the base url

Solution 1:

I just spent a good 4 hours trying to fix a similar problem. Here's what solved mine:

Summary: add a trailing '/' to your request

I found this post useful in fixing my problem. Basically, the server doesn't care if you send your request with a trailing '/' or not, because it internally routes to '/' if you don't add it. However, if the routing is happening internally (e.g. nginx passing the request to a local process), you get an http redirect which will make your request fail.

Solution 2:

I tried @Kadi's fix of adding a slash, and it worked, but a more elegant solution for me was to change the request from GET to POST, which also fixed the issue.

Still not sure what the root cause was.

Post a Comment for "Mixedcontent When I'm Loading Https Page Through Ajax, But Browser Still Thinks It's Http"