I recently deployed a WordPress site with OpenLiteSpeed on DokPloy and ran into a frustrating issue: everything seemed to work perfectly inside the container, but accessing the site through my domain gave me a 404 Not Found error from Traefik.
My Situation
When I tested the container directly with curl http://localhost from inside, it returned my WordPress homepage without any issues. The OpenLiteSpeed server was running fine, all processes were active, and the site was fully functional. Yet Traefik refused to route traffic to it.
What Was Actually Wrong
After digging through the logs, I discovered my container was marked as unhealthy. The problem? My healthcheck in my Docker Compose was configured like this:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
timeout: 10s
This was downloading my entire WordPress homepage on every healthcheck. Docker marked the container as unhealthy, and Traefik – correctly – refused to route traffic to an unhealthy backend.
The Solution
I changed the healthcheck to use a HEAD request instead, which only fetches headers without downloading the page content:
yaml
healthcheck:
test: ["CMD", "curl", "-f", "-I", "http://localhost"]
start_period: 30s
interval: 30s
retries: 3
timeout: 5s
The -I flag makes curl perform a HEAD request, which completes in milliseconds instead of timing out.
Verification
After redeploying with the updated healthcheck, I verified it worked:
docker ps | grep mycontainer
The status changed from (unhealthy) to (healthy), and immediately Traefik started routing traffic correctly. Site was live!
Lesson learned: When Traefik gives you 404s but your container works fine, always check docker ps for the health status. A simple healthcheck fix can save hours of debugging.

