接上文:nginx环境下配置nagios-关于nginx.conf

配置如下:

 1 server
 2 {
 3         listen       ;
 4         server_name  192.168.44.44;
 5         index index.html index.htm index.php;
 6         root  /usr/local/nagios/share;
 7         auth_basic "Nagios Access";
 8         auth_basic_user_file /usr/local/nagios/etc/nagiospasswd;
 9 
         location ~ .*\.(php|php5)?$
         {
                 # root /usr/local/nagios/share;
                 # fastcgi_pass  unix:/export/servers/nginx/logs/php-cgi.sock;
                 fastcgi_pass  127.0.0.1:;
                 fastcgi_index index.php;
                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                 #include fcgi.conf;
                 include /export/servers/nginx/conf/fastcgi_params;
         }
 
         location ~ \.cgi$
         {
                 root  /usr/local/nagios/share;
                 rewrite ^/nagios/cgi-bin/(.*)\.cgi /$.cgi break;
                 fastcgi_pass unix:/export/servers/nginx/logs/perl-fcgi.sock;
                 fastcgi_index index.cgi;
                 #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                 fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin$fastcgi_script_name;
                 #fastcgi_param HTTP_ACCEPT_LANGUAGE en_US;
                 include fastcgi_params;
         }
 
         location ~ \.pl$
         {
                 root  /usr/local/nagios/share;
                 fastcgi_pass  unix:/export/servers/nginx/logs/nginx-fcgi.sock;
                 fastcgi_index index.pl;
                 #fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                 fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin$fastcgi_script_name;
                 include /export/servers/nginx/conf/fastcgi_params;
         }
 
         location /nagios/
         {
                 gzip off;
                 alias /usr/local/nagios/share/;
         }
 
         location /stylesheets
         {
                 gzip off;
                 alias /usr/local/nagios/share/stylesheets;
         }
 
         location /pub
         {
                 gzip off;
                 alias /usr/local/nagios/share/docs;
         }
 
         location /pnp4nagios {
                 alias /usr/local/pnp4nagios/share;
                 index index.php;
                 try_files $uri $uri/ @pnp4nagios;
         }
 
         location @pnp4nagios {
                 fastcgi_pass  127.0.0.1:;
                 fastcgi_index       index.php;
                 include        fastcgi_params;
                 fastcgi_split_path_info ^(.+\.php)(.*)$;
                 fastcgi_param PATH_INFO $fastcgi_path_info;
                 fastcgi_param SCRIPT_FILENAME /usr/local/pnp4nagios/share/index.php;
         }
 

76 }

  1 user                    nagios  nagios;
  2 worker_processes                        ;
  3 worker_cpu_affinity                        ;
  4 error_log                /export/servers/nginx/logs/nginx_error.log  notice;
  5 pid                    /export/servers/nginx/logs/nginx.pid;
  6 worker_rlimit_nofile            ;
  7 events 
  8 {
  9     use epoll;
 10     worker_connections ;
 11 }
 12 http 
 13 {
 14     include                   mime.types;
 15     default_type              application/octet-stream;
 16     server_tokens             off;
 17     log_format main             '$remote_addr - $remote_user [$time_local] '
 18         '"$request" $status $bytes_sent '
 19         '"$http_referer" "$http_user_agent" '
 20         '"$gzip_ratio"';
 21     charset              utf-;
 22     server_names_hash_bucket_size   ;
 23     client_header_buffer_size     32k;
 24     large_client_header_buffers      32k;
 25     client_max_body_size         500m;
 26     sendfile             on;
 27     tcp_nopush                 on;
 28     keepalive_timeout         ;
 29     tcp_nodelay             on;
 30     client_body_buffer_size      1024k;
 31     fastcgi_intercept_errors     on;
 32     proxy_connect_timeout         ;
 33     proxy_read_timeout           ;
 34     proxy_send_timeout           ;
 35     proxy_buffer_size            256k;
 36     proxy_buffers                 256k;
 37     proxy_busy_buffers_size     256k;
 38     proxy_temp_file_write_size     256k;
 39     server_name_in_redirect     off;
 40     proxy_hide_header       X-Powered-By;
 41 
 42     fastcgi_connect_timeout 320m;
 43     fastcgi_send_timeout 320m;
 44     fastcgi_read_timeout 320m;
 45     gzip                 on;
 46     gzip_min_length          ;
 47     gzip_buffers              16k;
 48     gzip_http_version         1.0;
 49     gzip_comp_level         ;
 50     gzip_types               text/plain application/x-javascript text/css application/xml;
 51     gzip_vary             on;
 52     error_page       = /40x.html;
 53 #    error_page       = /50x.html;
 54     log_format  nagios_logs  '$remote_addr - $remote_user [$time_local] "$request" '
 55         '$status $body_bytes_sent "$http_referer" '
 56         '"$http_user_agent" $http_x_forwarded_for';
 57     access_log  /export/servers/nginx/logs/access_nagios.log  nagios_logs;        
 58 
 59     fastcgi_buffer_size         512k;
 60     fastcgi_buffers              512k;
 61     fastcgi_busy_buffers_size   640k;
 62     fastcgi_temp_file_write_size        640k;
 63     include domains/*;
 64 ###########status#########
 65     server
 66     {    
 67         listen                 80;
 68         server_name            status.nginx.com;
 69         location / {
 70         stub_status            on;
 71         access_log             off;
 72         }
 73     }
 74 }
 75 [root@b28-1241 conf]# q
 76 -bash: q: command not found
 77 [root@b28-1241 conf]# vi nginx.conf
 78 
 79                 '"$http_referer" "$http_user_agent" '
 80                 '"$gzip_ratio"';
 81         charset                         utf-8;
 82         server_names_hash_bucket_size   128;
 83         client_header_buffer_size       32k;
 84         large_client_header_buffers     4 32k;
 85         client_max_body_size            500m;
 86         sendfile                        on;
 87         tcp_nopush                      on;
 88         keepalive_timeout               0;
 89         tcp_nodelay                     on;
 90         client_body_buffer_size         1024k;
 91         fastcgi_intercept_errors        on;
 92         proxy_connect_timeout           90;
 93         proxy_read_timeout              180;
 94         proxy_send_timeout              180;
 95         proxy_buffer_size               256k;
 96         proxy_buffers                   4 256k;
 97         proxy_busy_buffers_size         256k;
 98         proxy_temp_file_write_size      256k;
 99         server_name_in_redirect         off;
         proxy_hide_header       X-Powered-By;
 
         fastcgi_connect_timeout 320m;
         fastcgi_send_timeout 320m;
         fastcgi_read_timeout 320m;
         gzip                            on;
         gzip_min_length                 100;
         gzip_buffers                    4 16k;
         gzip_http_version               1.0;
         gzip_comp_level                 9;
         gzip_types                      text/plain application/x-javascript text/css application/xml;
         gzip_vary                       on;
         error_page  400 401 402 403 404 = /40x.html;
 #       error_page  500 501 502 503 504 = /50x.html;
         log_format  nagios_logs  '$remote_addr - $remote_user [$time_local] "$request" '
                 '$status $body_bytes_sent "$http_referer" '
                 '"$http_user_agent" $http_x_forwarded_for';
         access_log  /export/servers/nginx/logs/access_nagios.log  nagios_logs;
 
         fastcgi_buffer_size         512k;
         fastcgi_buffers             24 512k;
         fastcgi_busy_buffers_size   640k;
         fastcgi_temp_file_write_size        640k;
         include domains/*;
 ###########status#########
         server
         {
                 listen                 80;
                 server_name            status.nginx.com;
                 location / {
                 stub_status            on;
                 access_log             off;
                 }
         }

134 }

nginx环境下配置nagios-关于nagios配置文件nginx.conf的更多相关文章

  1. nginx环境下配置nagiosQL-关于nagiosql配置文件

    接上文:nginx环境下配置nagios-关于nginx.conf nagiosql文件应该处于conf/domain/目录下 nagiosql配置如下: ;                  gzi ...

  2. Nginx环境下配置PHP使用的SSL认证(https)

    最近一段时间发现好多网站都从http协议变成了加密的https协议,比如说百度.吾志等等.https看起来比http高端了好多,而且在不同的浏览器向上还会显示出不同于http的URL展示效果(比如说c ...

  3. <nginx+PHP>nginx环境下配置支持php7

    [root@redhat7 ~]# wget http://am1.php.net/get/php-7.1.2.tar.gz/from/this/mirror [root@redhat7 ~]# ta ...

  4. nginx环境下配置nagios-关于start_perl_cgi.sh

    >/dev/ rm $dir/logs/perl-fcgi.sock >/dev/ echo  }    start ()  {  rm $dir/now_start_perl_fcgi. ...

  5. nginx环境下配置nagios-关于perl-fcgi.pl

    配置文件如下: 请注意,网上提供的官方文档在运行时可能会出现问题,此文中保证无问题. ; ; ; ;  ); ;  ); ; ;          my $pidnumber = $$;        ...

  6. phpmyadmin在nginx环境下配置错误

    location ~ \.css {           add_header  Content-Type    text/css;        } location ~ \.js {        ...

  7. nginx环境下配置nagios-关于commands.cfg

    -w $ARG1$ -c $ARG2$ -M -b% -c % -f% -c % -f% -c % -f #  define command{         command_name    chec ...

  8. 【thinkphp 5 在nginx 环境下路由无法生效(404 500错误 )的解决方法】

      非常惭愧的说,由于之前一直使用的是windowservice,安装apache来进行服务器布置的,这种方式也是最简单最直接的方式, 但是由于php的服务大多都是linux栈的,咱们也不能落后呀,在 ...

  9. nginx环境下启动php-fpm

    nginx环境下启动php-fpm 1.首先查看是否安装了php-fpm 这个我试了好多命令都不行比如 rpm -qa php-fpm , rpm -ql php-fpm , which php-fp ...

随机推荐

  1. git新建仓库

    克隆地址 git clone https://git.oschina.net/dy09/dy_shop.git 在克隆下来的文件夹里面进行下面的操作1.git add -A 2.git commit ...

  2. 2015GitWebRTC编译实录12

    2015.07.20 libjingle_peerconnection 编译通过[1382/1600 ] CXX obj/talk/app /webrtc/libjingle_peerconnecti ...

  3. tomcat切割日志的shell脚本

    #!/bin/bash cd /usr/tomcats/ d=`date +%F` m1=`date -d'1 month ago' +%F` ` do cd tomcat808"$i&qu ...

  4. Unity3D基础知识梳理

    这段时间在做Unity的项目,这差不多是我的第一次实战啊~然后公司来了实习的童鞋要学Unity,但是我一向不靠谱啊,所以只能帮他们稍微梳理下基础的东西了啊,唉~学长只能帮你们到这里了~顺便就把自己这两 ...

  5. tomcat内存溢出 PermGen space

    1. java.lang.OutOfMemoryError: PermGen space  ---- PermGen space溢出.  PermGen space的全称是Permanent Gene ...

  6. java空指针异常 for循环时,使用了值为null的变量

    错误代码: for(Map<String,Object> videoItemMap:learnVideoList){ String videoStuId=MapUtils.getStrin ...

  7. 7、java实现的两种单例模式

    /* 两种单例模式的演示 */ //饿汉式 class Signal { private Signal(){} private Signal s = new Signal(); public stat ...

  8. WCF: 没有终结点在侦听可以接受消息的 这通常是由于不正确的地址或者 SOAP 操作导致的。

    问题:     由于我这里的wcf服务是采用“BasicHttpBinding”的方式,即安全绑定模式,客户端在引用这个服务后所生成的终结点配置(endpoint )就变成了<endpoint ...

  9. (C# Binary Tree) 基本概念和算法

    A binary tree is defined as a tree where each node can have no more than two children. Building a Bi ...

  10. Hbase预分区种子生成

    提前生成Hbase预分区种子,在创建Hbase表时也进行相应的预分区,同时设置预分区的个数,预分区的范围对应Hbase监控页面的Region Server的start key与End key,从而使数 ...