upstream php5-fpm {
  server unix:/var/run/php5-fpm.sock;
}

upstream fcgiwrap {
  server unix:/var/run/fcgiwrap.sock;
}

server {
  listen 80;
  server_name nagios.pittcsc.org;

  root /usr/share/nagios3/htdocs;
  index index.php index.html;

  auth_basic "Nagios";
  auth_basic_user_file /etc/nagios3/htpasswd.users;

  location /stylesheets {
    alias /etc/nagios3/stylesheets;
  }

  location ~ \.cgi$ {
    root /usr/lib/cgi-bin/nagios3;

    rewrite ^/cgi-bin/nagios3/(.*)$ /$1;

    include /etc/nginx/fastcgi_params;
    fastcgi_param AUTH_USER $remote_user;
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name;
    fastcgi_pass fcgiwrap;
  }

  location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass php5-fpm;
  }
}

upstream php5-fpm {
  server unix:/var/run/php5-fpm.sock;
}

upstream fcgiwrap {
  server unix:/var/run/fcgiwrap.sock;
}

server {
  listen 80;
  server_name nagios.pittcsc.org;

  root /usr/share/nagios3/htdocs;
  index index.php index.html;

  location /stylesheets {
    alias /etc/nagios3/stylesheets;
  }

  location ~ \.cgi$ {
    root /usr/lib/cgi-bin/nagios3;

    rewrite ^/cgi-bin/nagios3/(.*)$ /$1;

    include /etc/nginx/fastcgi_params;
    fastcgi_param AUTH_USER $remote_user;
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name;
    fastcgi_pass fcgiwrap;
  }

  location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass php5-fpm;
  }
}

Disable basic auth for Nagios
Disable basic auth for Nagios
