# Exempting a file from the expires header

**URL:** <https://www.ruby-forum.com/t/exempting-a-file-from-the-expires-header/199582>\
**Category:** NGINX\
**Created:** [November 24, 2010, 3:17pm UTC](https://www.ruby-forum.com/t/exempting-a-file-from-the-expires-header/199582 "2010-11-24T15:17:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 24, 2010, 3:17pm UTC](https://www.ruby-forum.com/t/exempting-a-file-from-the-expires-header/199582/1 "2010-11-24T15:17:22Z")

</div>

HI all… I have implemented nginx as a front end proxy for my ISPconfig  
3 apache based web server. Works quite nice but I have one issue. I have  
some png files that are recreated every few minutes.

I am using the expires option on static files so I want to exempt these  
png files but not all png files.

If I understand correctly, this is done with another location directive,  
something like below

location /weather/graphics/\*.png {  
expires off  
root /var/www/VIRTUAL1.com/web/;  
access\_log /var/log/ispconfig/httpd/VIRTUAL1.com/access.log;

Question is where do I put this?

Thanks for your help…

Rob

My vhost conf file is below. host name has been changed…

server {

# listen 80;

server\_name [www.VIRTUAL1.com](http://www.VIRTUAL1.com) [VIRTUAL1.com](http://VIRTUAL1.com);  
#default proxy settings shared are among all virtual hosts  
access\_log off;  
include /etc/nginx/proxy.conf;  
location ~\*  
^.+.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|html?|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$  
{  
#forcing browser to cache locally static content for 1 day  
expires 1d;  
root /var/www/VIRTUAL1.com/web/;  
access\_log  
/var/log/ispconfig/httpd/VIRTUAL1.com/access.log;  
#graceful fallback in case if static content doesn’t exist  
\<------\> include /etc/nginx/proxy\_fallback.conf;  
}  
}

Posted at Nginx Forum:

> **[Exempting a file from the expires header](https://forum.nginx.org/read.php?2,152951,152951#msg-152951)**
>
> HI all.. I have implemented nginx as a front end proxy for my ISPconfig 3 apache based web server. Works quite nice but I have one issue. I have some png files that are recreated every few minutes. I am using the expires option on static files so I...
