Welcome! Log In Create A New Profile

Advanced

Re: help with location and order

June 11, 2010 05:50AM
On Fri, Jun 11, 2010 at 4:38 PM, Life Life <lists@ruby-forum.com> wrote:
> I have this config, I need to use jpg in /data/abc/files/ but when I
> browse it nginx will use file jpg in /var/www/images (second condition),
> how to fix it?
>
> root /var/www/images;
>
> location = /abc/files/ {

will only match address /abc/files/. Remove =.

>        alias /data/abc/files/;
>        break;
> }
>
> location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|swf|flv)$ {
>        access_log  off;
>        expires     1d;
> }

but any jpg will probably get in here anyway, so I guess using
location ~* ^/abc/files/(.*)$ {
alias /data/abs/files/$1;
}
is better. Also make sure to put that block above the location ~*
\.(jpg|jpeg|gif|css|png|js|ico|swf|flv)$ { } block.

> --
> Posted via http://www.ruby-forum.com/.
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

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

help with location and order

Life Life June 11, 2010 05:44AM

Re: help with location and order

edogawaconan June 11, 2010 05:50AM

Re: help with location and order

Igor Sysoev June 11, 2010 06:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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