mirror of
https://github.com/Dokploy/templates.git
synced 2026-07-16 04:48:50 -05:00
[GH-ISSUE #128] WordPress Template : REST API and Loopback Requests Failing due to cURL timeout (Error 28) #4357
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @thepiyushchandwani on GitHub (Apr 27, 2025).
Original GitHub issue: https://github.com/Dokploy/templates/issues/128
To Reproduce
You will find two major errors :
REST API is not working :
(http_request_failed) cURL error 28: Connection timed out after 10000 milliseconds
Loopback request failed :
cURL error 28: Connection timed out after 10000 milliseconds
Current vs. Expected behavior
Current Behavior:
After following the steps above, REST API endpoints fail to respond, and loopback requests timeout, breaking several WordPress features such as the Block Editor, scheduled cron jobs, and plugin/theme management.
Expected Behavior:
REST API endpoints and loopback requests should work immediately after a clean deployment without manual intervention, ensuring full functionality of WordPress.
Provide environment information
Which area(s) are affected? (Select all that apply)
Docker Compose, Traefik, Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
The site is accessible, but internal cURL requests fail, which seems related to networking setup in the template.
Will you send a PR to fix it?
No
@Siumauricio commented on GitHub (May 11, 2025):
Ok errors related to templates, they are handled in another repository, I will transfer
@JerresonJ commented on GitHub (Jun 2, 2025):
@Siumauricio
I don't think this is strictly a template issue. I am using a raw compose with my own custom WP image, and I am now seeing this issue in WP Health Check on deployments.
Raw Compose - network isolated deployment
Health check now shows it cannot complete loopback or rest api requests. I don't recall this ever showing during any prev tests.
Were any updates released that could be breaking something here?
I'll keep digging into it for a bit.
@thepiyushchandwani commented on GitHub (Jun 4, 2025):
@Siumauricio ,
After some digging, I found a solution that worked for my setup.
Problem
WordPress couldn't properly talk to itself using its public domain from inside the container. This caused issues like:
Solution
1. Set correct WordPress URLs in docker-compose.yml
Make sure the WordPress container knows its actual public URL:
2. Add extra_hosts to handle internal loopback
This was the key part.
a. Find your Traefik container's internal IP on the shared Docker network
Run:
Then look for something like:
Example:
b. Add extra_hosts to your WordPress service
Tell your WordPress container that requests to its public domain should route to Traefik's internal IP.
Here's how your
docker-compose.ymlwould look:Example Configuration
In my case, the working line looked like this:
Why This Works
When WordPress performs internal actions like cron jobs or health checks, it tries to connect to
https://yourdomain.com.Without extra_hosts: WordPress may try to go out to the public internet and route back in. This could be:
With extra_hosts: You force WordPress to resolve the domain to an internal IP (your Traefik container), making the request stay inside the Docker network.
How It Works
https://yourdomain.com10.0.1.48(Traefik's internal IP)yourdomain.com, and forwards it right back to the WordPress containerThis keeps everything local, fast, and reliable.
@JerresonJ commented on GitHub (Jun 4, 2025):
I went in a slightly different direction to make management easier.
Traefik handles all requests & SSL termination as usual.
https://myname.tld -> Traefik -> Container port 80Since we deploy our own WP images I added a MU Plugin that automatically forces all internal requests to
127.0.0.1So internal requests for
https://myname.tldare modified directly tohttp://127.0.0.1https://myname.tld -> http://127.0.0.1Now those requests never leave the container & they bypass DNS entirely.
This should effectively handle all requests WP makes for internal processes.
I'm letting this run for a bit & testing to ensure I didn't over-simplify this fix and break anything but this should work.