Welcome! Log In Create A New Profile

Advanced

simple alias

Posted by pferrel 
simple alias
June 28, 2012 04:03PM
I realize this is about as stupid a question as can be but...

I have a directory where I upload images to using Skitch where I will use them on my web site. Skitch uploads them to /home/pat/mydomain/bling

In Apache I have a directory and alias.

Alias /bling /home/pat/mydomain/bling
<Directory /home/pat/mydomain/bling>
Order allow,deny
Allow from all
</Directory>

I thought the following would do the equivalent in Nginx

location /bling/ {
root /home/pat/mydomain/bling;
}

if I go to http://mydomain/bling/someimage.jpg with Apache I see the image, with Nginx I get "not found".
Re: simple alias
June 28, 2012 04:23PM
Sure enough it was a stupid question, but at least I answered it myself :-)

should be

location /bling/ {
root /home/pat/mydomain;
}

in effect the /bling/ is appended to the root when matched in a URL so in the original config Nginx was trying to find /home/pat/mydomain/bling/bling/someimage.jpg
ooops
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
Record Number of Users: 5 on May 22, 2013
Record Number of Guests: 150 on May 22, 2013
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready