504 Gateway Time-out 如何解决

现在遇到网络请求未响应出现504错误问题解决方案 

原因:浏览器发起请求长时间未传回消息 

例:我给你借了钱 说了一个固定时间还 结果超过这个固定时间没还 这个时候我就开始寻求帮助了 

解决方案 找到nginx配置文件 未修改的 

        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;
		fastcgi_intercept_errors on;

fastcgi_connect_timeout  # 同 FastCGI 服务器的连接超时时间,默认值60秒,它不能超过75秒;
fastcgi_send_timeout       # Nginx 进程向 FastCGI 进程发送 request ,整个过程的超时时间,默认值60秒;
fastcgi_read_timeout       # FastCGI  进程向  Nginx  进程发送 response ,整个过程的超时时间,默认值60秒;

修改这些配置文件之后

        fastcgi_connect_timeout 60000;
        fastcgi_send_timeout 60000;
        fastcgi_read_timeout 60000;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 2 256k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;

修改之后问题解决 如果还不能解决的话 找到
 

location / {
        proxy_pass http://182.61.131.62:33060/;
        proxy_redirect  off;
        proxy_send_timeout 300;
        proxy_read_timeout 300;
        proxy_connect_timeout 300;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

修改

        proxy_send_timeout 300;
        proxy_read_timeout 300;
        proxy_connect_timeout 300;

如果没有就添加进去 问题解决了 如果说的不对请指正 谢谢!!!

猜你喜欢

转载自blog.csdn.net/yzs2022/article/details/131170231
今日推荐