# About location

**URL:** <https://www.ruby-forum.com/t/about-location/187049>\
**Category:** NGINX\
**Created:** [April 16, 2010, 7:21am UTC](https://www.ruby-forum.com/t/about-location/187049 "2010-04-16T07:21:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 16, 2010, 7:21am UTC](https://www.ruby-forum.com/t/about-location/187049/1 "2010-04-16T07:21:26Z")

</div>

Can i use this sentence in location ?

```
        if ($request_uri ~* "^/(list|small|big)_.*") {
            expires 1m;
        }
```

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 16, 2010, 7:26am UTC](https://www.ruby-forum.com/t/about-location/187049/2 "2010-04-16T07:26:07Z")

</div>

On Fri, Apr 16, 2010 at 11:05:59AM +0800, æŽç¿ wrote:

> Can i use this sentence in location ?
> 
> ```
> if ($request_uri ~* "^/(list|small|big)_.*") {
> expires 1m;
> }
> 
> ```

You should use just location:

```
   location ~* "^/(list|small|big)_.*") {
        expires 1m;
   }

```

or better several static prefix locations:

```
   location /list_ {
        expires 1m;
   }

   location /small_ {
        expires 1m;
   }

   location /big_ {
        expires 1m;
   }

```

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**
