Welcome! Log In Create A New Profile

Advanced

Noob question - Root vs Alias and image_filter

Posted by elhostis 
Noob question - Root vs Alias and image_filter
May 15, 2013 07:55AM
Hi,

I'm starting with nginx, and I have some problems with resize of pictures. And when I'm trying my conf, I see I did not realy undersand some basic concepts.

My first problem :
I have a url like this : http://localhost/media/test/titi/toto.jpg
And it works good with this configuration :
location ~ /media/test/(.*) {
alias /var/www/html/toto/$1;
}

But it doen't work with this config.
location ~ /media/test/(.*) {
root /var/www/html/toto;
}
I don't understand why ?

My second problem is about resize. Why did it not work ?

location ~ /media/test/(.*) {
image_filter resize 50 10;
alias /var/www/html/toto/$1;
}

Thanks for your help.


Eric
Re: Noob question - Root vs Alias and image_filter
May 15, 2013 10:24AM
Ok, I have resolved my problem about resize.
The solution is to add a location to the path. Like that :


location ~ /media/test/(.*) {
image_filter resize 50 10;
proxy_pass http://127.0.0.1/my_image/$1
}

location /my_image {
alias /var/www/html/toto/;
}
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