Welcome! Log In Create A New Profile

Advanced

alias vs root in regex location

April 10, 2015 07:09PM
Trying to serve nagios web GUI through nginx.

Part of config:

location ~ "^/nagios/(.+?\.php)(/.*)?$"
{
alias "/usr/share/nagios3/htdocs/";
try_files $1 $uri $uri/ /nagios/index.php;
#rewrite "^/nagios/(.+?\.php)(/.*)?$" /$1$2 break;

auth_basic "Authorization required to access Nagios";
auth_basic_user_file htpasswd;

# PHP-FPM Settings
include avi9526/php-fpm;
}
location ~* ^/cgi-bin/nagios3/(.+?\.cgi)$
{
alias "/usr/lib/cgi-bin/nagios3/";
try_files $1 $uri $uri/ =404;
#rewrite "^/cgi-bin/nagios3/(.+?\.cgi)$" /$1 break;

auth_basic "Authorization required to access Nagios";
auth_basic_user_file htpasswd;

fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;

include avi9526/fcgiwrap;
}

it's seems to be working. If i change "alias" to "root" and uncomment "rewrite" directive for both php and cgi scripts it will work as well. So, what the difference? And why most online manuals suggests to use "root" followed by rewrite?
Subject Author Posted

alias vs root in regex location

avi9526 April 10, 2015 07:09PM

Re: alias vs root in regex location

Francis Daly April 11, 2015 06:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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