Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

256
Visualizações
Port conflict by Apache httpd and by docker-compose on AWS EC2

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:

  1. Edited the httpd.conf and changed port from 80 to 443;
  2. Revised ports in the docker-compose.yml from 80 to 443

If I stopped Apache then the creation process worked.

May I know:

  1. How to resolve the ports conflict? (/etc is in parallel to the repository's root folder. I am not sure whether this caused the issue)
  2. What is the right way to make https work in this case?
  3. Is it how GraghQL client connect to backend server?

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}"

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda