Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set some Expires in a lot of JavaScript that I got here, but they are not static on filesystem, it is dynamic generated by a Java application.

If I do this:

  location /bla {
    root /tmp;
    expires 30m;
  }

And put some .js files inside /tmp/bla everything works fine.

But when I try to do this:

  location /script {
    expires 30m;
    proxy_cache cache;
    proxy_pass http://localhost:8080;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
  }

Does not work. The reply from the server is always 200, never 304 as it should be.

What can I do to fix this?

I also tried to use nginx 1.3.3 with Etag support, but also only works with static files :(

Thanks!!

share|improve this question
2  
If you think your app server should be returning 304 instead of 200, then we should be looking at it, and not nginx. – Michael Hampton Aug 7 '12 at 20:38

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.