Welcome! Log In Create A New Profile

Advanced

Nginx 403 error

Posted by LMWR 
Nginx 403 error
May 12, 2011 12:40AM
I have Nagios + Nginx running on Debian Lenny box. I've updated from Nagios in Lenny repos to Nagios in Squeeze repos. Everything was working before that. Now, when I try to access nagios on http://myserver/nagios3/ I'm allowed to enter credentials, but after that I'm constantly getting "403 Forbidden" error.

nginx logs show:

"no user/password was provided for basic authentication, client: x.x.x.x, server: x.x.x.x, request: "GET /nagios3/ HTTP/1.1", host: "x.x.x.x""
"directory index of "/usr/share/nagios3/htdocs/" is forbidden, client: x.x.x.x, server: x.x.x.x, request: "GET /nagios3/ HTTP/1.1", host: "x.x.x.x""

As I was reading through Internet, I found that possible reason for that error to happen is plain text password in htpasswd file. However, I've used Apache's util to generate it.

Here's my nginx.conf:

server {
listen x.x.x.x:80;
server_name nagios3;

access_log /var/log/nginx/nagios_access.log;

location /nagios3/ {
root /usr/share/nagios3/htdocs;
index index.html;

rewrite ^/nagios3/(.*)$ /$1 break;

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

location ~ \.cgi$ {
root /usr/lib/cgi-bin/nagios3;
rewrite ^/cgi-bin/nagios3/(.*)$ /$1;

include /usr/local/nginx/conf/fastcgi_params;

fastcgi_pass 127.0.0.1:8999;
fastcgi_param SERVER_PORT 80;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name;
auth_basic "Nagios login";
auth_basic_user_file /etc/nagios3/htpasswd.users;

fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
}
}

All folder's permissions seem to be set OK. Can anyone shed some light on that?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
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