mirror of
https://github.com/Dokploy/templates.git
synced 2026-07-15 14:52:05 -05:00
[PR #1011] [MERGED] fix(wordpress): route loopback requests through Traefik to fix cURL error 28 timeouts #16319
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?
📋 Pull Request Information
Original PR: https://github.com/Dokploy/templates/pull/1011
Author: @Siumauricio
Created: 7/14/2026
Status: ✅ Merged
Merged: 7/14/2026
Merged by: @Siumauricio
Base:
canary← Head:fix/wordpress-loopback📝 Commits (1)
af16250fix(wordpress): route loopback requests through Traefik to fix cURL error 28📊 Changes
2 files changed (+24 additions, -1 deletions)
View changed files
📝
blueprints/wordpress/docker-compose.yml(+22 -0)📝
blueprints/wordpress/template.toml(+2 -1)📄 Description
Problem
Fresh WordPress deployments report two Site Health errors (#128):
(http_request_failed) cURL error 28: Connection timed out after 10000 millisecondscURL error 28: Connection timed out after 10000 millisecondsThis breaks WP-Cron, the block editor checks, and plugin/theme management.
Root cause
Inside the container, WordPress resolves its own public domain to the server's public IP, so every loopback request (REST API self-check, WP-Cron, Site Health) has to leave the container and hairpin back through the host to Traefik. Whether that works depends entirely on the host's hairpin-NAT/firewall setup — on many VPS/cloud configurations the packets are dropped and the request times out with cURL error 28.
Verified empirically on a live Dokploy deployment by running diagnostics inside the container:
Fix
At container startup, resolve
dokploy-traefikon the shared Docker network and pin<traefik-ip> <domain>in/etc/hosts. Loopback traffic then goes container → Traefik → container entirely inside the Docker network — no hairpin NAT involved — and works for both HTTP and HTTPS (Traefik serves the real certificate).Details:
pinned after 2 tries). Apache startup is never delayed.dokploy-traefikis not resolvable — behavior falls back to exactly what it is today.WP_DOMAINis passed from the template's${main_domain}so the pinned host always matches the generated domain.Verification (live deploy on Dokploy)
In-container diagnostics after the fix:
WordPress's own Site Health loopback test (the exact check from the issue), run as an authenticated admin against the final template:
Fresh install flow, external REST API (
/wp-json/→ 200) and admin login all verified working.node build-scripts/generate-meta.js --checkpasses (476 templates validated).Closes #128
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.