I have a web-page hosted in S3 bucket, and it is setup for HTTPS.
My back-end runs on an AWS Lightsail instance with a static IP address that my front-end makes requests to to get JSON data. The server is a Python Flask server that is running within a Docker container.
When I run docker run -p 443:MY_PORT ...
(port 443 is Lightsail's HTTPS port) I cannot get my front-end to communicate with the server. Instead I get this error:
spread.js:25 Mixed Content: The page at 'https://www.bible-it.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ... This request has been blocked; the content must be served over HTTPS.
There are no problems, if I run my docker command through port 80.
What is the best way to setup HTTPS for my Lightsail instance?
Also if my setup of
FRONTEND: s3 Bucket
BACKEND: Lightsail > Ubuntu > Docker > Python Flask
is a bad setup please let me know. I am self taught and would love some guidance. Thank you so much.