![504 超时,无论我增加多少超时参数](https://linux22.com/image/726131/504%20%E8%B6%85%E6%97%B6%EF%BC%8C%E6%97%A0%E8%AE%BA%E6%88%91%E5%A2%9E%E5%8A%A0%E5%A4%9A%E5%B0%91%E8%B6%85%E6%97%B6%E5%8F%82%E6%95%B0.png)
我尝试增加/usr/local/etc/nginx/valet/valet.conf
文件中的超时值:
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 500M;
client_header_timeout 3000;
client_body_timeout 3000;
location /41c270e4-5535-4daa-b23e-c269744c2f45/ {
internal;
alias /;
try_files $uri $uri/;
}
location / {
rewrite ^ /Users/Me/.composer/vendor/laravel/valet/server.php last;
}
access_log off;
error_log /Users/Me/.valet/Log/nginx-error.log;
error_page 404 /Users/Me/.composer/vendor/laravel/valet/server.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/Users/Me/.valet/valet.sock;
fastcgi_index /Users/Me/.composer/vendor/laravel/valet/server.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /Users/Me/.composer/vendor/laravel/valet/server.php;
fastcgi_read_timeout 3000;
fastcgi_send_timeout 1200;
fastcgi_connect_timeout 1200;
fastcgi_buffers 32 64k;
fastcgi_buffer_size 128k;
proxy_connect_timeout 3000;
proxy_send_timeout 3000;
proxy_read_timeout 3000;
send_timeout 3000;
}
location ~ /\.ht {
deny all;
}
}
尝试添加request_terminate_timeout = 3000
到 php.ini 并增加以下值:
max_input_time = 900
max_execution_time = 900
这是在 php.ini 文件中显示的php --ini
:
/usr/local/etc/php/7.2/php.ini
我已经重新启动了 php 和 nginx。
我仍然在 30 秒时超时。
我在这里遗漏了什么?
答案1
该问题是由于 Laravel Valet在目录上~/.valet/Nginx/yoursite.conf
执行操作后在其下创建了一个单独的 conf 文件而引起的。valet secure
将超时更改添加到该配置文件,然后重新启动 valet 即可解决问题。