开发者

Trouble setting expiration for static asset in nginx

I have the following location directive in my nginx config file:

server{
  ...
  location ~* \.js$ {expires 1d;}
  .开发者_C百科..
  location / {
  ...
 }
}

I expect a file served by this URL http://www.mydomain.com/javascripts/myfile.js to have an expiration of +1 day, but I am seeing an expiration of +20 years. What am I doing wrong?


It turns out that I was supposed to edit proxy.conf. Once I did that, it worked swimmingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜