# Expires header for cache

**URL:** <https://www.ruby-forum.com/t/expires-header-for-cache/189501>\
**Category:** NGINX\
**Created:** [June 1, 2010, 10:32pm UTC](https://www.ruby-forum.com/t/expires-header-for-cache/189501 "2010-06-01T22:32:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![discCIT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@discCIT](https://www.ruby-forum.com/u/discCIT)\
**Post date:** [June 1, 2010, 10:32pm UTC](https://www.ruby-forum.com/t/expires-header-for-cache/189501/1 "2010-06-01T22:32:27Z")

</div>

I am trying to get the expires header to work on the cache module. I am  
limiting what content can be accessed and then would like to cache that  
content. It is working to only server the specified content but it is  
not serving the expires header. The backend server is not set to send  
and expires header and with the code below I get a an expiration not  
specified result. Here is that portion of the conf file -

location ~\* (.jpg|.png|.gif|.css|ThumbNail.ashx|heartbeat.htm)$ {

```
valid_referers
  none
  blocked
  mysite.com
  www.mysite.com
  1.mysite.com
  2.mysite.com
  3.mysite.com
  4.mysite.com;

if ($invalid_referer) {
  return 444;
}

  proxy_pass http://mysite_com;
  proxy_cache_valid 200 301 302 1480m;
                    expires 5d;
  proxy_cache dci;
  proxy_cache_use_stale error timeout invalid_header updating;

}

```

Posted at Nginx Forum:

> **[Expires header for cache](https://forum.nginx.org/read.php?2,93304,93304#msg-93304)**
>
> I am trying to get the expires header to work on the cache module. I am limiting what content can be accessed and then would like to cache that content. It is working to only server the specified content but it is not serving the expires header. The...
