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: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready