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

600
Visualizações
Error: cURL error 28: Resolving timed out after 10000 milliseconds (http_request_failed) with nginx reverse proxy in docker

I am trying to set up a local Wordpress environment using Docker Compose with Nginx reverse proxy. WordPress. works but in Site Health I get:

Error: cURL error 28: Resolving timed out after 10000 milliseconds (http_request_failed)

This my docker-compose file

version: '3.1'

services:

  web:
    image: nginx
    ports:
      - "80:80"
    volumes:
      - ./site.conf:/etc/nginx/conf.d/site.conf
    depends_on:
      - wordpress
      - db

  wordpress:
    image: wordpress
    expose:
      - 80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: local_user
      WORDPRESS_DB_PASSWORD: secret
      WORDPRESS_DB_NAME: local
    volumes:
      - ./wordpress:/var/www/html

  db:
    image: mysql:5.7
    environment:
      MYSQL_DATABASE: local
      MYSQL_USER: local_user
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: root_secret
    ports:
      - 3306:3306
    volumes:
      - ./mysql:/var/lib/mysql

this is my Nginx config file:

upstream backend{
    server wordpress:80;
}

server {
    listen 80;
    listen [::]:80;

    index index.php index.html;
    server_name bedrock.local; 
    # error_log  /var/log/nginx/error.log;
    # access_log /var/log/nginx/access.log;
    # root /code/web;

    location / {
        proxy_pass http://backend/;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

}

bedrock.local domain resolves locally with 127.0.0.1 in /etc/hosts I'm not using HTTPS (just HTTP) to simplify the test.

Thanks!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I had the same issue, Wordpress container cannot reach the website on the public IP address due to the Docker networking.

The best solution to this is to add the fqdn aliases to the Nginx container in the docker-compose.yml file to allow Wordpress to reach Nginx internally.

This config will solve the issue:

web:
  image: nginx
  ports:
    - "80:80"
  volumes:
    - ./site.conf:/etc/nginx/conf.d/site.conf
  depends_on:
    - wordpress
    - db
  networks:
    default:
      aliases:
        - yourwebsite.com
        - www.yourwebsite.com
over 4 years ago · Santiago Trujillo Relatório
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