- 论坛徽章:
- 0
|
本帖最后由 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;
}
之后查找了一下,没有找到可解决该问题的方法,大家帮忙看一下吧,谢谢 |
|