
Zabbix는 nginx_status를 가져오려고 할 때 301 오류를 표시합니다.
이 내 꺼야zabbix.conf좋다:
server {
listen [::]:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
access_log off;
error_log /var/log/nginx/nginx_status_error.log;
}
location ~ ^/(status|ping)$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:7777;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
allow 127.0.0.1;
deny all;
}
}
컬을 시도할 때 다음 오류가 발생합니다.
$ curl 127.0.0.1:80/status
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
메시지 없음/var/log/nginx/nginx_status_error.log
왜 이런 일이 발생하는지, 근본 원인을 어디서 찾을 수 있는지 잘 모르겠습니다. 이 오류를 제거하려면 어떻게 해야 하거나 확인해야 합니까?
편집하다:
$ curl -i 127.0.0.1:80/status
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 21 Oct 2019 11:01:17 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://127.0.0.1/status
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
해결책:
나는 주석을 달고 listen [::]:80;
포트를 에 추가했습니다 server_name 127.0.0.1:80;
.
$ curl -i 127.0.0.1:80/status
HTTP/1.1 200 OK