Laravel Valet 504 网关超时 nginx/1.19.6 60 秒后

问题描述

我按照此处的所有说明进行操作:

https://github.com/laravel/valet/issues/315

我注意到性能更好,尤其是在更新 Valet 的 PM 池配置之后。 (现在一些执行开始完成,因为所需的时间不到 60 秒)。

但执行时间更长,60 秒后仍然显示错误

实际上是我的conf。文件是这样的:

valet-fpm.conf

; FPM pool configuration for Valet

[valet]
user = xxx
group = staff
listen = /Users/xxx/.config/valet/valet.sock
listen.owner = xxx
listen.group = staff
listen.mode = 0777

;; When uncommented,the following values will take precedence over settings declared elsewhere
;PHP_admin_value[memory_limit] = 512M
;PHP_admin_value[upload_max_filesize] = 128M
;PHP_admin_value[post_max_size] = 128M

;PHP_admin_value[error_log] = /Users/xxx/.config/valet/Log/PHP-fpm.log
;PHP_admin_flag[log_errors] = on


;; Note: increasing these values will increase the demand on your cpu and RAM resources
pm = dynamic
;pm.max_children = 5
;pm.start_servers = 2
;pm.min_spare_servers = 1
;pm.max_spare_servers = 3

pm.max_children = 200
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 20
pm.process_idle_timeout = 10s
pm.max_requests = 500

valet.conf

server {
    listen 127.0.0.1:80 default_server;
    root /;
    charset utf-8;
    client_max_body_size 128M;

    location /41c270e4-5535-4daa-b23e-c269744c2f45/ {
        internal;
        alias /;
        try_files $uri $uri/;
    }

    location / {
        rewrite ^ "/Users/xxx/.composer/vendor/laravel/valet/server.PHP" last;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log "/Users/xxx/.config/valet/Log/Nginx-error.log";

    error_page 404 "/Users/xxx/.composer/vendor/laravel/valet/server.PHP";

    location ~ [^/]\.PHP(/|$) {
        fastcgi_split_path_info ^(.+\.PHP)(/.+)$;
        fastcgi_pass "unix:/Users/xxx/.config/valet/valet.sock";
        fastcgi_index "/Users/xxx/.composer/vendor/laravel/valet/server.PHP";
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME "/Users/xxx/.composer/vendor/laravel/valet/server.PHP";
        fastcgi_param PATH_INFO $fastcgi_path_info;

        proxy_connect_timeout       3000;
        proxy_send_timeout          3000;
        proxy_read_timeout          3000;
        send_timeout                3000;
    }

    location ~ /\.ht {
        deny all;
    }
}

Nginx.conf

user "xxx" staff;
#worker_processes auto;
worker_processes 8;

events {
    worker_connections  1024;
}

http {
    include mime.types;
    default_type  application/octet-stream;

    sendfile on;
    keepalive_timeout  650;
    types_hash_max_size 2048;

    client_max_body_size 1024M;


    client_header_timeout 3000;
    client_body_timeout 3000;
    fastcgi_read_timeout 3000;
    fastcgi_buffers 8 128k;
    fastcgi_buffer_size 128k;



    server_names_hash_bucket_size 128;

    ssi on;

    gzip  on;
    gzip_comp_level 5;
    gzip_min_length 256;
    gzip_proxied any;
    gzip_vary on;
    gzip_types
    application/atom+xml
    application/javascript
    application/json
    application/RSS+xml
    application/vnd.ms-fontobject
    application/x-font-ttf
    application/x-web-app-manifest+json
    application/xhtml+xml
    application/xml
    font/opentype
    image/svg+xml
    image/x-icon
    text/css
    text/plain
    text/x-component;

    include "/Users/xxx/.config/valet/Nginx/*";
    include servers/*;
    include valet/valet.conf;
}

我还需要修改什么? 提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)