在安装 wordpress 后遇到一个问题,打开后台的 theme 页面后,一直无法加载出来内容,查看后台 nginx 的日志,发现如下错误:

[error] 10929#10929: *337 upstream timed out (110: Connection timed out) while reading upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /wp-admin/theme-install.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "127.0.0.1", referrer: "http://127.0.0.1/wp-admin/themes.php"

大概是处理 php 页面的时候 timeout 了,Google 了发现问题出在转发到代理服务器 fastCGI 时超时了:https://talk.plesk.com/threads/upstream-timed-out-110-connection-timed-out-randomly.350497/
解决方案就是在 nginx 配置文件内定义一下相关超时时间设定:

proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

将上述内容加入 config 文件,reload nginx 测试页面加载是否正常:

sudo service nginx configtest
sudo service nginx reload


标签:timeout, fastcgi

你的评论