index directive not taking effect in case of alias

yashgt nginx-forum at nginx.us
Wed Aug 22 11:07:42 UTC 2012


I would like the pnp4nagios app to be accessed as:
http://server/pnp4nagios/. With this URL it gives a 403 Forbidden error. It
works when I give: http://server/pnp4nagios/index.php.
What might be wrong?

Here is the pnp4nagios location config:

    location ~ /pnp4nagios {
        alias $pnp4nagiosbase/share;
        auth_basic           "Nagios Restricted"; ## Message shown in login
window
        auth_basic_user_file $nagiosbase/etc/htpasswd.users ; ## See
/etc/nginx/htpassword
        index index.php;
        try_files $uri $uri/ @handler ; ## If missing pass the URI to
Magento's front handler

        location ~ /([^\/]*\.php)$ {
            alias  $pnp4nagiosbase/share/$1;
            #include /etc/nginx/fastcgi.conf;
            fastcgi_pass   $fcgipass;
            fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;
            include        fastcgi_params; ## See /etc/nginx/fastcgi_params
        }

        location ~ \.php$ {
            #include /etc/nginx/fastcgi.conf;
            include        fastcgi_params; ## See /etc/nginx/fastcgi_params
            fastcgi_pass   $fcgipass;
        }

    }
	
Thanks,
Yash

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229985,229985#msg-229985



More information about the nginx mailing list