Welcome! Log In Create A New Profile

Advanced

Re: nginx rewrite

May 02, 2011 02:12PM
On Mon, May 02, 2011 at 07:54:57PM +0200, Yanxin Z. wrote:
> Hello,
> I need to rewrite the URL
>
> /img/14567.jpg to /img/14/14567.jpg
>
> The image name is 14567.jpg, which is saved in /14 folder. /14 is
> caluculated by 14567 / 1000
>
> How to implement is NGX rewrite?

location /img/ {
location ~ ^/img/(..)(.+)$ {
alias /path/to/img/$1/$1$2;
}
}


--
Igor Sysoev

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

nginx rewrite

Yanxin Z. May 02, 2011 01:56PM

Re: nginx rewrite

Igor Sysoev May 02, 2011 02:12PM

Re: nginx rewrite

Yanxin Z. May 02, 2011 02:50PM

Re: nginx rewrite

Igor Sysoev May 02, 2011 02:58PM

Re: nginx rewrite

Maxim Dounin May 02, 2011 03:20PM

Re: nginx rewrite

Yanxin Z. May 02, 2011 03:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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