-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Sporadic cURL error 28: Resolving timed out after 5000 milliseconds #761
-
Hi, I'm using WordPress FPM 8.0 with the official NGINX image as a reverse proxy. I'm getting cURL error 28: Resolving timed out after 5000 milliseconds, sporadically, on pages that use wp_remote_post to get data from an Express.js API in the same datacenter (but different domain). The proxy I believe can be excluded from this problem, because the same error was logged with Open LiteSpeed proxy also.
The wp_remote_post gets the data 99% of the time, but I'd still like to know why this error happens 10-20 times a day.
Also, I had the chance to call the API using Postman within seconds of error being logged, and it responded within 100ms on each call I made.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
I had this issue, it was caused by the container not being able to properly resolve to itself via my nginx revese proxy
the fix was to add the extra_hosts directive to the yaml for the container as so.
wordpress:
image: wordpress:latest
ports:
- 8080:80
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: xxxxx
WORDPRESS_DB_PASSWORD: xxxxxx
WORDPRESS_DB_NAME: wordpressdb
extra_hosts:
- mydomain.com:<externa-facing-lip>
volumes:
- www:/var/www/html
Beta Was this translation helpful? Give feedback.