nginx static files caching doesn't work
Posted
by
user74344
on Server Fault
See other posts from Server Fault
or by user74344
Published on 2011-03-13T23:38:05Z
Indexed on
2011/03/14
0:11 UTC
Read the original article
Hit count: 505
here is my conf file: usr/local/nginx/sites-available/default
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|swf)$ {
expires 30d;
}
but it doesn't cache static files, how should I fix it? thanks a lot
© Server Fault or respective owner