Location URI Wildcard

Maxim Dounin mdounin at mdounin.ru
Tue Apr 3 22:20:40 UTC 2012


Hello!

On Tue, Apr 03, 2012 at 03:10:07PM -0700, Justin Dorfman wrote:

> Hello,
> 
> I am trying to find a way to redirect a bunch of jpg files to an html page.
> 
> This way is not working:
> 
> location = /attach/201204*.jpg {
>             root /usr/local/nginx/html;
>             index suspend.html;
> }
> 
> Here is a real world file name: 201204031012088721.jpg

location ~ ^/attach/201204.*\.jpg$ {
    alias /usr/local/nginx/html/suspend.html;
}

Maxim Dounin



More information about the nginx mailing list