Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

599
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!