# Lua: ngx.location.capture / limit proxy\_cache individual file size

**URL:** <https://www.ruby-forum.com/t/lua-ngx-location-capture-limit-proxy-cache-individual-file-size/207167>\
**Category:** NGINX\
**Created:** [May 19, 2011, 8:16pm UTC](https://www.ruby-forum.com/t/lua-ngx-location-capture-limit-proxy-cache-individual-file-size/207167 "2011-05-19T20:16:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 19, 2011, 8:16pm UTC](https://www.ruby-forum.com/t/lua-ngx-location-capture-limit-proxy-cache-individual-file-size/207167/1 "2011-05-19T20:16:26Z")

</div>

Hi  
Is it possible to do a version of ngx.location.capture that only does a  
HEAD request rather than GET?  
I’m only interested in the headers returned, the body would make what  
I’m trying to do pointless ☹

Also if anyone has another method/idea of how to do this:  
I want to limit requests for files of size greater than 512000 bytes  
using proxy\_cache and actively deny and not cache them  
I tried some stuff with ‘if’ but it’s evaluated before the  
upstream-content-length is set ☹

---

<div class="post-metadata">

**Author:** ![rkoskela](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce73a5/32.png) [@rkoskela](https://www.ruby-forum.com/u/rkoskela)\
**Post date:** [May 20, 2011, 8:52am UTC](https://www.ruby-forum.com/t/lua-ngx-location-capture-limit-proxy-cache-individual-file-size/207167/2 "2011-05-20T08:52:08Z")

</div>

On Fri, May 20, 2011 at 2:15 AM, Richard K.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is it possible to do a version of ngx.location.capture that only does a HEAD  
> request rather than GET?

Please try

```
ngx.location.capture("/some-location", { method = ngx.HTTP_HEAD })

```

If it does not work, please consider file a bug ticket on GitHub:

```
https://github.com/chaoslawful/lua-nginx-module/issues

```

> Im only interested in the headers returned, the body would make what Im  
> trying to do pointless L

_nod_

Best,  
-agentzh
