Nagios served by NginX

nofun nginx-forum at
Thu Dec 30 19:23:38 MSK 2010

Can some one please help me setting up Nagios on NginX. I installed
spawn-fcgi and fcgiwrap in Ubuntu, and I have Nagios 3.2.3 installed in
/opt/nagios. So I have the two folders: /opt/nagios/share for web files,
and /opt/nagios/sbin for cgi scripts.

I tried with this config (with no success though):
location / {
		root   /opt/nagios/share;
		index  index.html;
		rewrite	^/nagios/images/(.*)\.png /images/$1.png break;
		auth_basic		"Restricted";
		auth_basic_user_file	conf/htpasswd;
	location ~ \.cgi$ {
		root	/opt/nagios/sbin;
		rewrite	^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;
		include /etc/nginx/fastcgi_params;
        	fastcgi_pass   unix:/var/run/fcgiwrap.socket;
	        fastcgi_param  SCRIPT_FILENAME 
/opt/nagios$fastcgi_script_name;  # same path as above
		auth_basic		"Restricted";
		auth_basic_user_file	conf/htpasswd;
		fastcgi_param  AUTH_USER          $remote_user;
		fastcgi_param  REMOTE_USER	  $remote_user;

This config is adaped from

Does anyone use Nagios with NginX and can send me a working

Thank you in advance,

Posted at Nginx Forum:,162278,162278#msg-162278

More information about the nginx mailing list