The issue started with the connection between GraghQL client and Apollo server. I setup the client on NextJS and deployed the backend on AWS EC2 with docker-compose. I put in "http://xxx" as the uri for client and received error:
"Mixed Content: The page was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint nextjs"
So I tried to get SSL/TLS on the backend and followed AWS' instructions: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-2.html
When trying to start Apache, I received error:
"Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details."
I then stopped the container by running "docker-compose down" and I was able to start Apache. After the site supports https, I ran "docker-compose up --build" and it says the ports are already used. I tried the following one by one but the issue still exit:
If I stopped Apache then the creation process worked.
May I know:
docker-compose.yml
version: '3.6'
services:
graphql-server:
container_name: backend
build: ./
command:
bash -c "export TWILIO_EMAIL_KEY="${TWILIO_EMAIL_KEY}" && npm start"
working_dir: /src/graphqlserver
ports:
- "80:4000"
environment:
- TWILIO_EMAIL_KEY="${TWILIO_EMAIL_KEY}"