Nginx admin-ajax.php 502 Bad Gateway
-
My sites are behind an nginx reverse proxy, I was getting a lot of
admin-ajax.php 502 Bad Gateway nginx
I noticed that:
2024/02/13 15:25:25 [warn] 196#196: *346692 upstream server temporarily disabled while reading response header from upstream, client: X.Y.W.Z, server: mysite.com, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "https://172.18.0.11:80/wp-admin/admin-ajax.php", host: "mysite.com", referrer: "https://mysite.com/wp-admin/upload.php?page=images-to-webp.php&tab=convert"
2024/02/13 15:25:25 [error] 196#196: *346692 upstream timed out (110: Operation timed out) while reading response header from upstream, client: X.Y.W.Z, server: mysite.com, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "https://172.18.0.11:80/wp-admin/admin-ajax.php", host: "mysite.com", referrer: "https://mysite.com/wp-admin/upload.php?page=images-to-webp.php&tab=convert"
mysite.com X.Y.W.Z - - [13/Feb/2024:15:25:25 +0000] "POST /wp-admin/admin-ajax.php HTTP/2.0" 504 562 "https://mysite.com/wp-admin/upload.php?page=images-to-webp.php&tab=convert" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
2024/02/13 15:25:25 [error] 196#196: *346692 no live upstreams while connecting to upstream, client: X.Y.W.Z, server: mysite.com, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "https://mysite.com/wp-admin/admin-ajax.php", host: "mysite.com", referrer: "https://mysite.com/wp-admin/upload.php?page=images-to-webp.php&tab=convert"
mysite.com X.Y.W.Z - - [13/Feb/2024:15:25:25 +0000] "POST /wp-admin/admin-ajax.php HTTP/2.0" 502 552 "https://mysite.com/wp-admin/upload.php?page=images-to-webp.php&tab=convert" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
Wondering if there’s a better way to code this in order to avoid the timeout.. a solution is to increase the nginx read timeout:
location / {
proxy_read_timeout 1800;
- The topic ‘Nginx admin-ajax.php 502 Bad Gateway’ is closed to new replies.