一直想在内网穿透的环境下运行WordPress,但是由于WordPress的一个插件一直运行超时错误的问题未解决而作罢,这次有空调试一下,看看能否解决:
1.检查nginx中fastcgi(php-fpm)60s超时的问题
在站点配置文件中加上fastcgi_read_timeout 600;
location ~ .*.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_connect_timeout 600;
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_index index.php;
include fastcgi.conf;
}
2.检查nginx.conf反向代理的超时配置
在http节段增加如下配置
client_header_buffer_size 32k;
large_client_header_buffers 4 64k;
client_max_body_size 8m;
keepalive_timeout 600;
client_header_timeout 600;
client_body_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
3.检查php.ini相关超时配置
output_buffering = On
max_execution_time = 600
max_input_time = 600
default_socket_timeout = 600
4.检查frps.ini相关超时配置
heartbeat_timeout = 600
vhost_http_timeout = 600
5.检查frpc.ini相关超时配置
vhost_http_timeout = 600
# heartbeat_interval = 600
# heartbeat_timeout = 600
问题最终解决,考虑1、2、4、5的可能性比较大。