# Alias

**URL:** <https://www.ruby-forum.com/t/alias/237977>\
**Category:** NGINX\
**Created:** [December 9, 2013, 6:04pm UTC](https://www.ruby-forum.com/t/alias/237977 "2013-12-09T18:04:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [December 9, 2013, 6:04pm UTC](https://www.ruby-forum.com/t/alias/237977/1 "2013-12-09T18:04:24Z")

</div>

hi all, i just had a quick question about this example.

* * *

http {  
server {  
server\_name localhost;  
root /var/www/website.com/html;  
location /admin/ {  
alias /var/www/locked/;  
}  
}  
}  
When a request for [http://localhost/](http://localhost/) is received, files are served from  
the  
/var/www/website.com/html/ folder. However, if Nginx receives a request  
for  
[http://localhost/admin/](http://localhost/admin/), the path used to retrieve the files is  
/home/website.  
com/locked/.

* * *

my question is about the alias variable inside the location /admin/ {}  
block. It clearly shows /var/www/locked/ as its path, but when  
explained below, it says the path is /home/website.com/locked/…

Please can someone tell me how:  
/home/website.com/locked/ == /var/www/locked/ ??  
I’m new to linux so maybe it’s something i’m unaware of.

also the path having [website.com](http://website.com) in it. Does this mean a directory was  
named [website.com](http://website.com), with the period?

---

<div class="post-metadata">

**Author:** ![Matthew\_Ngaha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Matthew\_Ngaha](https://www.ruby-forum.com/u/Matthew_Ngaha)\
**Post date:** [December 9, 2013, 7:33pm UTC](https://www.ruby-forum.com/t/alias/237977/2 "2013-12-09T19:33:50Z")

</div>

On Mon, Dec 09, 2013 at 05:03:55PM +0000, Matthew Ngaha wrote:

Hi there,

> hi all, i just had a quick question about this example.

Where does the example come from? It may be worth asking the author to  
fix it.

> http {  
> server {  
> server\_name localhost;  
> root /var/www/website.com/html;  
> location /admin/ {  
> alias /var/www/locked/;  
> }  
> }  
> }

If you ask for [http://localhost/request.html](http://localhost/request.html), nginx will try to  
send the file /var/www/website.com/html/request.html. If you ask for  
[http://localhost/admin/request.html](http://localhost/admin/request.html), nginx will try to send the file  
/var/www/locked/request.html.

> my question is about the alias variable inside the location /admin/ {}  
> block. It clearly shows /var/www/locked/ as its path, but when  
> explained below, it says the path is /home/website.com/locked/…

The explanation is wrong.

> also the path having [website.com](http://website.com) in it. Does this mean a directory was  
> named [website.com](http://website.com), with the period?

Yes.

## f

Francis D. removed\_email\_address@domain.invalid
