December 30, 2010 11:36AM
This works for me:

http
{
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
client_max_body_size 6m;
gzip on;
gzip_min_length 0;
gzip_comp_level 6;
gzip_types text/css application/json application/x-javascript text/xml
application/xml application/xml+rss text/javascript;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
access_log off;
root /var/www/html;
server
{
listen 10.0.1.163;
server_name dev.local.com;
location = /nagios
{
rewrite ^/nagios/ permanent;
}
location /nagios/
{
index index.php index.html;
alias /usr/local/nagios/share/;
}
location /
{
index index.php index.html;
error_page 404 = @joomla;
log_not_found off;
}
location @joomla
{
rewrite ^(.*)$ /index.php?q=$1 last;
}
location ~ ^/nagios/(.*\.php)$
{
alias /usr/local/nagios/share/$1;
fastcgi_pass 127.0.0.1:9000;
include fcgi;
auth_basic "Restricted";
auth_basic_user_file htpasswd;
}
location ~ \.cgi$
{
root /usr/local/nagios/sbin/;
rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;
fastcgi_pass 127.0.0.1:49233;
include fcgi;

auth_basic "Restricted";
auth_basic_user_file htpasswd;

fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
}
location ~ \.php$
{
include fcgi;
fastcgi_pass 127.0.0.1:9000;
}

}



On Thu, Dec 30, 2010 at 11:23 AM, nofun <nginx-forum@nginx.us> wrote:

> 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):
> [code]
> 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;
> }
> [/code]
>
> This config is adaped from
> http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/
>
> Does anyone use Nagios with NginX and can send me a working
> configuration?
>
> Thank you in advance,
> Vlad.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,162278,162278#msg-162278
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nagios served by NginX

nofun December 30, 2010 11:23AM

Re: Nagios served by NginX

iberkner December 30, 2010 11:36AM

Re: Nagios served by NginX

nofun December 30, 2010 12:05PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 245
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready