Welcome! Log In Create A New Profile

Advanced

Re: Alias in Nginx

Maxim Dounin
March 31, 2010 12:00PM
Hello!

On Wed, Mar 31, 2010 at 11:25:58AM -0400, Michel Vega Fuenzalida wrote:

> Hello List, sorry my english,
>
> I would like do like in Apache is make: "Alias /pepe /usr/share/pepe"
> Who I can do it in Nginx?

Use this:

location /pepe {
root /usr/share;
}

In case uri prefix doesn't match directory name, e.g. "Alias /pepe
/usr/share/something-else", one should use this:

location /pepe {
alias /usr/share/something-else;
}

It is possible to use "alias" in your case too, but variant with
"root" is a bit more efficient.

See here for details:

http://wiki.nginx.org/NginxHttpCoreModule#location
http://wiki.nginx.org/NginxHttpCoreModule#root
http://wiki.nginx.org/NginxHttpCoreModule#alias

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Alias in Nginx

Michel Vega Fuenzalida March 31, 2010 11:32AM

Re: Alias in Nginx

Maxim Dounin March 31, 2010 12:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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