# Re: alias

**URL:** <https://www.ruby-forum.com/t/re-alias/237997>\
**Category:** NGINX\
**Created:** [December 10, 2013, 11:18pm UTC](https://www.ruby-forum.com/t/re-alias/237997 "2013-12-10T23:18:18Z")\
**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 10, 2013, 11:18pm UTC](https://www.ruby-forum.com/t/re-alias/237997/1 "2013-12-10T23:18:18Z")

</div>

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

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

Hi Francis It was from nginx http server

> 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.

The problem i’ve been having after looking in the error logs,is that  
it’s still trying to find /admin/ in the default html root. I’ve tried  
new locations, new roots inside these new locations for /admin/, and  
now ive tried alias. All have been 404 Not Found due to nginx  
searching for these paths in root html; …Any ideas how i can write  
this? Here’s is my default setup, how could i create an alternative  
path from the root.

```
server {
    listen 80;
    server_name localhost;
    root html;
    #charset koi8-r;

    #access_log logs/host.access.log main;
    }

```

Also i don’t know how this message will turn out, i only recieve daily  
digests so i had to reply to the digest and not individual the mail  
itself. Is there a way to stop recieving nginx mail via digests and  
just recieve each individual mail?

---

<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 10, 2013, 11:41pm UTC](https://www.ruby-forum.com/t/re-alias/237997/2 "2013-12-10T23:41:40Z")

</div>

On Tue, Dec 10, 2013 at 10:17:25PM +0000, Matthew Ngaha wrote:

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

Hi there,

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

> The problem i’ve been having after looking in the error logs,is that  
> it’s still trying to find /admin/ in the default html root.

That suggests that the configuration you are editing, and the  
configuration that nginx is using, are not the same.

You can test by adding the following line:

```
location = /test/ {return 200 "This is a test\n";}

```

just after the server\_name line and reloading nginx.

If “curl -i [http://localhost/test/](http://localhost/test/)” does not show you “This is a test”,  
then that’s your problem.

After you fix that, the rest should become clear.

> Also i don’t know how this message will turn out, i only recieve daily  
> digests so i had to reply to the digest and not individual the mail  
> itself. Is there a way to stop recieving nginx mail via digests and  
> just recieve each individual mail?

Start here:

> [nginx Info Page](http://mailman.nginx.org/mailman/listinfo/nginx)

Cheers,

## f

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