Requesting an HTTP resource from HTTPS Website

I have an HTTPS Gatsby site at https://nervous-stonebraker-07cdb0.netlify.com/
I am trying to fire an XHR request to grab bus schedule data from my city’s public bus schedule API. That API is hosted with HTTP.

In various browsers, I am receiving errors:

Chrome: Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure resource ‘’. This request has been blocked; the content must be served over HTTPS.

Firefox: Blocked loading mixed active content…

Is there anything I can do on my side? Can I opt to request HTTP content?

Hey @wesspacito,

There’s an interesting discussion at the end of this topic which you may wish to explore in order to serve the call in a seemingly secure manner.

2 Likes

Yea, the solution mentioned there is probably the only way to do that. :+1:

@Pieparker Thank you!

@Dennis Thanks for checking in! A lot of the example _redirects involve an internal backend. I’m having difficulty making this approach work for my use case with an external resource. My project is a one-page Gatsby app, the only page I care about is home “/”. The http resource is “http://webservices.nextbus.com/service/publicJSONFeed?.…”

I’ve tried many iterations of:

/* http://webservices.nextbus.com/service/* 200! 

What should the _redirect syntax for this look like?

That redirect rule is not quite right. You can use an * in the ‘to’ section of the rule. Perhaps the following works for you:

/* http://webservices.nextbus.com/service/:splat 200

Let me know if that helps.