回答
收藏
分享
举报
upstream_addr字段记录了两个后端服务器的地址?这个时候nginx代理服务器返回的是500
提问于2020-07-06 15:47

浏览 2.7k

nginx日志,upstream_addr字段有时记录了两个后端服务器的地址?这个时候nginx代理服务器返回的是500。这个是什么情况?请老师解释一下。

已修改于2023-03-17 02:10



写下您的回答
发表回答
全部回答(2)

按点赞数排序

按时间排序

upstream中的2个server IP,当其中一个server异常后的重试。

赞同

3

回复举报

回答于2020-07-09 21:20



回复Omg
回复

当有访问失败时,upstream_addr 会记录尝试访问过的地址,可能会有多个,以逗号分隔


500建议配置 error_log,打开日志文件查看具体的错误原因

赞同

1

回复举报

回答于2021-08-24 15:59



回复friparia
回复
相关问答

你采用的是什么负载均衡策略?

点赞 0
浏览 1.3k

低版本,编译会打印md5和sha1。我测试1.10版本,是打印md5和sha1的,1.11以上不打印了,可以查看
https://github.com/nginx/nginx/tree/master源代码代码仓库auto/summary文件,里面有描述。下面为我本地Ubuntu18.04编译指令:
在代码根目录运行,./auto/configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream --with-stream_ssl_module --add-module=/home/lq/work/tongmingzhiyun/openresty/lua-nginx-module-0.10.21 --add-module=/home/lq/work/tongmingzhiyun/openresty/ngx_devel_kit-0.3.1
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library

nginx path prefix: "/opt/nginx"
nginx binary file: "/opt/nginx/sbin/nginx"
nginx modules path: "/opt/nginx/modules"
nginx configuration prefix: "/opt/nginx/conf"
nginx configuration file: "/opt/nginx/conf/nginx.conf"
nginx pid file: "/opt/nginx/logs/nginx.pid"
nginx error log file: "/opt/nginx/logs/error.log"
nginx http access log file: "/opt/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"

点赞 0
浏览 921

请试试dmesg查看内核日志信息

点赞 0
浏览 796