# Nginx 0.8.53/0.7.67 unable to return 304

**URL:** <https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876>\
**Category:** NGINX\
**Created:** [November 9, 2010, 11:23pm UTC](https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876 "2010-11-09T23:23:22Z")\
**Posts on this page:** 5\
**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 9, 2010, 11:23pm UTC](https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876/1 "2010-11-09T23:23:22Z")

</div>

Hi all,

need help with nginx configuration, I had configured a very simple  
static file caching or direct from disk, but nginx did not return 304  
when if-modified-since header is in the request.

if-modified-since exact;

```
    location / {

        root /www;
        index index.php index.html index.htm;
        expires 1d;

    }

```

thanks

rchen

Posted at Nginx Forum:

> **[nginx 0.8.53/0.7.67 unable to return 304](https://forum.nginx.org/read.php?2,149315,149315#msg-149315)**
>
> Hi all, need help with nginx configuration, I had configured a very simple static file caching or direct from disk, but nginx did not return 304 when if-modified-since header is in the request. if-modified-since exact; location / {

---

<div class="post-metadata">

**Author:** ![rchen9012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@rchen9012](https://www.ruby-forum.com/u/rchen9012)\
**Post date:** [November 9, 2010, 11:29pm UTC](https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876/2 "2010-11-09T23:29:39Z")

</div>

here is the request and response header

User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12)  
Gecko/20101026 Firefox/3.6.12  
Accept image/png,image/_;q=0.8,_/_;q=0.5  
Accept-Language en-us,en;q=0.5  
Accept-Encoding gzip,deflate  
Accept-Charset ISO-8859-1,utf-8;q=0.7,_;q=0.7  
Keep-Alive 115  
Connection keep-alive  
If-Modified-Since Fri, 10 Sep 2010 00:10:07 GMT  
Cache-Control max-age=0

Server nginx  
Date Tue, 09 Nov 2010 22:26:50 GMT  
Content-Type image/gif  
Content-Length 5541  
Last-Modified Fri, 10 Sep 2010 00:10:07 GMT  
Connection keep-alive  
Expires Wed, 10 Nov 2010 22:26:50 GMT  
Cache-Control max-age=86400  
Accept-Ranges bytes

Posted at Nginx Forum:

> **[Re: nginx 0.8.53/0.7.67 unable to return 304](https://forum.nginx.org/read.php?2,149315,149316#msg-149316)**
>
> Hi all, need help with nginx configuration, I had configured a very simple static file caching or direct from disk, but nginx did not return 304 when if-modified-since header is in the request. if-modified-since exact; location / {

---

<div class="post-metadata">

**Author:** ![rchen9012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@rchen9012](https://www.ruby-forum.com/u/rchen9012)\
**Post date:** [November 10, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876/3 "2010-11-10T15:41:27Z")

</div>

Hi Maxim,

we have installed with default modules, and test with firefox 3.6.12 to  
retrieve a gif file, not matter how we change the configuration, we  
still get 200 in return.

Regards

Posted at Nginx Forum:

> **[Re: nginx 0.8.53/0.7.67 unable to return 304](https://forum.nginx.org/read.php?2,149315,149500#msg-149500)**
>
> Hi all, need help with nginx configuration, I had configured a very simple static file caching or direct from disk, but nginx did not return 304 when if-modified-since header is in the request. if-modified-since exact; location / {

---

<div class="post-metadata">

**Author:** ![rchen9012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@rchen9012](https://www.ruby-forum.com/u/rchen9012)\
**Post date:** [November 10, 2010, 1:09am UTC](https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876/4 "2010-11-10T01:09:16Z")

</div>

Hello!

On Tue, Nov 09, 2010 at 05:22:04PM -0500, rchen9012 wrote:

> need help with nginx configuration, I had configured a very simple  
> static file caching or direct from disk, but nginx did not return 304  
> when if-modified-since header is in the request.
> 
> if-modified-since exact;

Just a side note: there is no such directive; there is  
if\_modified\_since one.

> ```
> location / {
> 
> root /www;
> index index.php index.html index.htm;
> expires 1d;
> 
> }
> 
> ```

The basic question is: how did you test?

Hint: never trust browsers and various “http headers” plugins, in  
many cache-related cases they show incorrect info. Looking what  
happens on the wire (tcpdump, wireshark) or at least intercepting  
traffic with debugging proxy (fiddler) is recommended.

Maxim D.

---

<div class="post-metadata">

**Author:** ![rchen9012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@rchen9012](https://www.ruby-forum.com/u/rchen9012)\
**Post date:** [November 10, 2010, 3:42pm UTC](https://www.ruby-forum.com/t/nginx-0-8-53-0-7-67-unable-to-return-304/198876/5 "2010-11-10T15:42:42Z")

</div>

On Wed, Nov 10, 2010 at 09:40:11AM -0500, rchen9012 wrote:

> Hi Maxim,
> 
> we have installed with default modules, and test with firefox 3.6.12 to  
> retrieve a gif file, not matter how we change the configuration, we  
> still get 200 in return.

Could you create debug log of the request ?

> **[A debugging log](http://nginx.org/en/docs/debugging_log.html)**

–  
Igor S.

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