I tried deploying a Heroku web app with my Flask backend (not on Heroku, actually on GCP) and got the following message in my browser's dev console:
Mixed Content: The page at 'https://x.herokuapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://x:5000/endpoint'. This request has been blocked; the content must be served over HTTPS.
I have little experience with serving and SSL, but the first temptation here would be to find a way to make Heroku okay with using http endpoints. And I'd love to avoid setting up SSL if possible.
What are my options from here?
Thanks!
x
). You definitely want to (continue to) use TLS (HTTPS) but, e.g. App Engine can help with this. Assumingx:5000
is a reference within the heroku app, you should drop thehttp://
and thex
(the reference should just be a relative/endpoint
) and you should run Flask on (App Engine's preferred) port8080
rather than5000
. – DazWilkin