nginx平台下搭建nagios监控问题
本帖最后由 tankazrael9999 于 2011-04-13 17:55 编辑
在nginx下搭建nagios监控,再对主机启用或禁用提交后提示 502 Bad Gateway错误,之后查看nginx错误日志,发现如下错误:
*3 upstream closed prematurely FastCGI stdout while reading response header from upstream, client: 192.168.1.100, server: www.whjjs.cn, request: "POST /nagios/cgi-bin/cmd.cgi HTTP/1.1", upstream: "fastcgi://unix:/var/run/nginx/nginx-fcgi.sock:", host: "www.whjjs.cn:9999", referrer: "http://www.whjjs.cn:9999/nagios/cgi-bin/cmd.cgi?cmd_typ=23&host=119126.32.36&service=mysql_port_3327"
nginx配置文件内容如下:
server
{
listen 9999;
server_name www.whjjs.cn
index index.php index.html index.htm;
root /home/nagios/share;
fastcgi_connect_timeout 400;
fastcgi_send_timeout 400;
fastcgi_read_timeout 400;
fastcgi_buffer_size 64k;
fastcgi_buffers 8 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
location ~ .*\.php?$
{
fastcgi_pass 127.0.0.1:9100;
fastcgi_index index.php;
include /home/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/nagios/share$fastcgi_script_name;
}
location /nagios/
{
gzip off;
alias /home/nagios/share/;
index index.html index.htm index.php;
auth_basic "whjjs access";
auth_basic_user_file /home/nginx/conf/htpasswd;
}
location ~* ^/nagios/cgi-bin/ {
fastcgi_pass unix:/var/run/nginx/nginx-fcgi.sock;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME /home/nagios/sbin$fastcgi_script_name;
fastcgi_param HTTP_ACCEPT_LANGUAGE en_US;
include /home/nginx/conf/fastcgi_params;
auth_basic "whjjs access";
auth_basic_user_file /home/nginx/conf/htpasswd;
}
location ~ \.pl$ {
fastcgi_pass unix:/var/run/nginx/nginx-fcgi.sock;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME /home/nagios/sbin$fastcgi_script_name;
include /home/nginx/conf/fastcgi_params;
}
之后查找了一下,没有找到可解决该问题的方法,大家帮忙看一下吧,谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也遇到同样的问题,不知道楼主解决了没有
我也遇到同样的问题的,我的问题应该是nginx与perl组合的时候,产生了权限的问题的.http://bbs.chinaunix.net/thread-3577689-1-1.html
回复 1# tankazrael9999
请问楼主,找到原因了嘛?我现在也遇到这个问题了。感觉上是CGI的问题,但是无从下手啊。知道方法的话,请教一下啊。
求解啊!请求各们~~有木有已经解决的!