nginx / 未分类 · 2012年2月21日

nginx expires 图片过期日期

[root@_lekool ~]# mkdir -p /data/tmp/evan
[root@_lekool ~]# cp /usr/local/nginx/conf/nginx.conf /data/tmp/evan/.
[root@_lekool ~]# sed -i “s/expires 7d/expires 730d/” /usr/local/nginx/conf/nginx.conf
[root@_lekool ~]# grep expires /usr/local/nginx/conf/nginx.conf
expires 730d;
expires 730d;
[root@_lekool ~]# /etc/init.d/nginx check
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@_lekool ~]# /etc/init.d/nginx reload
###大亨的
server {
listen 8002;
server_name img100.bto.dovogame.com;
charset utf-8;
access_log /dev/null main;
root /data/;
### by evan
index index.htm index.html;
location ~ .*.(gif|jpg|jpeg|png|bmp|ico|swf|html|htm|mp3|wma|js|css)$ {
expires 365d;
}
### by evan
location / {
index index.html index.htm;
}