nginx的重试机制

nginx的重试机制_nginx 30秒就超时__tsubasa_的博客-CSDN博客

Nginx 失败重试机制 - 知乎 (zhihu.com)

现在对外服务的网站,很少只使用一个服务节点,而是部署多台服务器,上层通过一定机制保证容错和负载均衡

nginx就是常用的一种HTTP和反向代理服务器,支持容错和负载均衡。

nginx的重试机制就是容错的一种。

在nginx的配置文件中,proxy_next_upstream项定义了什么情况下进行重试,官网文档中给出的说明如下:

 

Syntax:	proxy_next_upstream error | timeout | invalid_header | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | off ...;
Default:	proxy_next_upstream error timeout;
Context:	http, server, location

默认情况下,当请求服务器发生错误或超时时,会尝试到下一台服务器。

posted @ 2023-07-21 10:03  CharyGao  阅读(302)  评论(0)    收藏  举报