Hi,
No, there isn't.
Alias works in that way (you can test with random directories with
static files), it may not work with your configuration, because your configuration is not suitable in this case and/or there is something wrong with it.
If I understand you right, you have let's say
/home/www for your document root. In that folder you have subfolder
nm, in which you have sub-folder (sub-sub-folder of the document root) called
nm-admin or you have only
nm-admin folder in the document root which you would like to open in your browser with the name
nm with
alias? Or other maybe?
If it is the first case, i.e physical directories:
Code:
/home/www - document root
/home/www/nm - subfolder in the document root
/home/www/nm/nm-admin - sub-sub-folder in the document root
you don't need to make any changes in the configuration, if you open in your browser
http://example.com/nm/nm-admin/ it will work, if you open
http://example.com/nm/ it will also work.
But if it is the second case, i.e physical directories:
Code:
/home/www - document root
/home/www/nm-admin - subfolder in document root, which when you try to open http://example.com/nm/ should be proceeded
usually this is done by symlinks, instead of
alias or just by renaming the folder with the name you would like.
Of course in some cases where your folder is not in the document root, you will have to link it with
alias. And of course, if the folder is located in the document root with name
nm-admin and you want to be named just
nm in server side, and you don't want to make symlink, rename folder for any reason, you can perform this by the next example and very basic config:
(Physical directory structure is case 2, one sub-folder called
nm-admin in the document root, which should be "renamed" by the server to the name
nm.)
Code:
server
{
listen your_ip;
server_name server_name;
root /home/www
index some_indexes;
// link your static files from subfolder to the new name
location /nm/ // (1) when you try to open in the browser any static file: http://example.com/nm/somefile.jpg
{
alias /home/www/nm-admin/; // (2) point (1) to physical directory on the filesystem (inside or outside document root, no matter)
}
//
// link your dynamic files from subfolder to the new name
location ~ ^/nm/(.+\.php)$ // (3) when you try to open in the browser: http://example.com/nm/somefile.php
{
alias /home/www/nm-admin/$1; // (4) point (3) to physical directory on the filesystem (inside or outside document root, no matter)
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass your_socket;
}
//
// link your dynamic files from document root (physically placed there)
location ~ \.php$ // (5) matches otherfiles.php in the document root except files from (4), for example: /home/www/index.php
{
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass your_socket;
}
//
}
However, I may be don't get what you really try to achieve, so please paste your physical directories and what would you like to open in your browser with simple words (links
). I downloaded first program and took a look in its code and structure, no any special requirements needed to configure it to run on any web server, no
.htaccess-es, just one small folder which you have to place in your document root.