Alias in Nginx

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?

Thank for all.


Usemos el Software Libre “Con todos y para el bien de todos”
José Martí, 26 de noviembre de 1891, Tampa.

Lic. Michel Vega Fuenzalida. Usuario Linux: 353763
Coordinador del Grupo Linux Pinero
Administrador de Red
Hospital General Docente “Héroes de Baire”,
Nueva Gerona, Isla de la Juventud, Cuba.

Teléfono: +53 46 323012.

Este mensaje le ha llegado mediante el servicio de correo electronico
que ofrece Infomed para respaldar el cumplimiento de las misiones del
Sistema Nacional de Salud. La persona que envia este correo asume el
compromiso de usar el servicio a tales fines y cumplir con las
regulaciones establecidas

Infomed: http://www.sld.cu/

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs