美文网首页
nginx处理长连接请求,解决gateway timeout错误

nginx处理长连接请求,解决gateway timeout错误

作者: LUNJINGJIE | 来源:发表于2018-12-10 09:55 被阅读0次
console报错: gateway timeout , 报504错误
1.当系统中存在长连接

nginx配置文件中,默认超时连接为60s,在一些特殊的业务请求中,可能存在超过60s的数据请求,此时需要修改配置文件以满足业务要求;

常用的nginx命令:
启动nginx : start nginx
关闭nginx(快速停止) : nginx -s stop
关闭nginx(正常停止) :nginx -s quit
重新加载配置文件 : nginx -s reload
查看所有nginx占用端口是否在运行(默认80端口) : netstat -an|find "0:80"
停止所有nginx服务 : taskkill /F /IM nginx.exe > nul
修改配置文件中的location标签:
location / {
            root   dist;
            index  index.html index.htm;
            proxy_read_timeout 150; // 设置代理超时时间
        }

相关文章

网友评论

      本文标题:nginx处理长连接请求,解决gateway timeout错误

      本文链接:https://www.haomeiwen.com/subject/jrevqqtx.html