nginx编译加入nginx_upstream_check_module后访问时报错500 Internal Server Error
查看配置过程都正常,后来发现是upstream里没有加入check参数
upstream shopping{ server 192.168.26.180:9700; server 192.168.26.181:9700; check interval=3000 rise=2 fall=5 timeout=1000 type=tcp; }
# 重新加载配置文件
service nginx reload
如果不加check参数,查看访问日志发现有报错500或403,如下
# 报错500
IP - - [04/Jan/2021:10:22:29 +0800] "GET /nstatus HTTP/1.1" 500 572 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36" "-" "-" "-" "-" "-" "-" | "-"
# 报错403 IP - - [04/Jan/2021:10:33:54 +0800] "GET /favicon.ico HTTP/1.1" 403 548 "http://192.168.26.180/nstatus" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36" "-" "-" "-" "-" "-" "-" | "-"
转载请注明出处!