This works for me:<div><br></div><div><div>http</div><div>{</div><div>    include       /etc/nginx/mime.types;</div><div>    default_type  application/octet-stream;</div><div>    sendfile on;</div><div>    tcp_nopush on;</div>
<div>    client_max_body_size 6m;</div><div>    gzip on;</div><div>    gzip_min_length 0;</div><div>    gzip_comp_level 6;</div><div>    gzip_types text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;</div>
<div>    log_format   main &#39;$remote_addr - $remote_user [$time_local] $status &#39;</div><div>                      &#39;&quot;$request&quot; $body_bytes_sent &quot;$http_referer&quot; &#39;</div><div>                      &#39;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#39;;</div>
<div>    access_log   /var/log/nginx/access.log  main;</div><div>    access_log off;</div><div>    root /var/www/html;</div><div>    server</div><div>    {</div><div>        listen  10.0.1.163;</div><div>        server_name  <a href="http://dev.local.com">dev.local.com</a>;</div>
<div>        location = /nagios</div><div>        {</div><div>                rewrite ^/nagios/ permanent;</div><div>        }</div><div>        location /nagios/</div><div>        {</div><div>                index index.php index.html;</div>
<div>                alias /usr/local/nagios/share/;</div><div>        }</div><div>        location /</div><div>        {</div><div>                index  index.php index.html;</div><div>                error_page 404 = @joomla;</div>
<div>                log_not_found off;</div><div>        }</div><div>        location @joomla</div><div>        {</div><div>                rewrite ^(.*)$ /index.php?q=$1 last;</div><div>        }</div><div>        location ~ ^/nagios/(.*\.php)$</div>
<div>        {</div><div>                alias /usr/local/nagios/share/$1;</div><div>                fastcgi_pass <a href="http://127.0.0.1:9000">127.0.0.1:9000</a>;</div><div>                include fcgi;</div><div>                auth_basic &quot;Restricted&quot;;</div>
<div>                auth_basic_user_file htpasswd;</div><div>        }</div><div>        location ~ \.cgi$</div><div>        {</div><div>                root    /usr/local/nagios/sbin/;</div><div>                rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;</div>
<div>                fastcgi_pass   <a href="http://127.0.0.1:49233">127.0.0.1:49233</a>;</div><div>                include fcgi;</div><div><br></div><div>                auth_basic              &quot;Restricted&quot;;</div>
<div>                auth_basic_user_file    htpasswd;</div><div><br></div><div>                fastcgi_param  AUTH_USER          $remote_user;</div><div>                fastcgi_param  REMOTE_USER        $remote_user;</div>
<div>        }</div><div>        location ~ \.php$</div><div>        {</div><div>                include fcgi;</div><div>                fastcgi_pass <a href="http://127.0.0.1:9000">127.0.0.1:9000</a>;</div><div>        }</div>
<div><br></div><div>    }</div><div><br></div><div><br></div><br><div class="gmail_quote">On Thu, Dec 30, 2010 at 11:23 AM, nofun <span dir="ltr">&lt;<a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Can some one please help me setting up Nagios on NginX. I installed<br>
spawn-fcgi and fcgiwrap in Ubuntu, and I have Nagios 3.2.3 installed in<br>
/opt/nagios. So I have the two folders: /opt/nagios/share for web files,<br>
and /opt/nagios/sbin for cgi scripts.<br>
<br>
I tried with this config (with no success though):<br>
[code]<br>
location / {<br>
                root   /opt/nagios/share;<br>
                index  index.html;<br>
<br>
                rewrite ^/nagios/images/(.*)\.png /images/$1.png break;<br>
<br>
                auth_basic              &quot;Restricted&quot;;<br>
                auth_basic_user_file    conf/htpasswd;<br>
        }<br>
<br>
        location ~ \.cgi$ {<br>
                root    /opt/nagios/sbin;<br>
                rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;<br>
<br>
                include /etc/nginx/fastcgi_params;<br>
<br>
                fastcgi_pass   unix:/var/run/fcgiwrap.socket;<br>
                fastcgi_param  SCRIPT_FILENAME<br>
/opt/nagios$fastcgi_script_name;  # same path as above<br>
<br>
                auth_basic              &quot;Restricted&quot;;<br>
                auth_basic_user_file    conf/htpasswd;<br>
<br>
                fastcgi_param  AUTH_USER          $remote_user;<br>
                fastcgi_param  REMOTE_USER        $remote_user;<br>
        }<br>
[/code]<br>
<br>
This config is adaped from<br>
<a href="http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/" target="_blank">http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/</a><br>
<br>
Does anyone use Nagios with NginX and can send me a working<br>
configuration?<br>
<br>
Thank you in advance,<br>
Vlad.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,162278,162278#msg-162278" target="_blank">http://forum.nginx.org/read.php?2,162278,162278#msg-162278</a><br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>