论坛风格切换切换到宽版
  • 566阅读
  • 0回复

[Ubuntu] Ubuntu nginx expires无效 [复制链接]

上一主题 下一主题
离线62712345.
 
发帖
2088
C币
-306683
威望
380
贡献值
1
银元
-3
铜钱
4663
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-04-27
本帖最后由 .娱乐随你. 于 2010-02-12 13:22 编辑 服务器
server {

listen   80;

server_name  www.xxx.c..om xxx.com;          婚庆

index. index.html index.php ind.ex.htm;              乙肝

ac.cess_log off;             电子

charset utf8;



root   /var/www/xxx..com;           建材





if ($host !~ "^www\..xxx\.com$"). {    健康

rewrite ^(.*) http://www.xxx.com$1 permanent;              乙肝

}



location ~*. .\.(js|css|jpg|jpeg|gif|png)$ {.

r.oot   /var/www/xxx.com;健康

expires 3d;

#break;

}



location ~* \.(html)$. {.

root   /var/w.ww/xxx.com;电影

expires 6h;

#break;

}



error_page 404 /404.ht.ml;.



# redirect server. error pages to the static page ./50x.html.



#error_.page   500 502 503 .504 /50x.html;.



#locatio.n = /50x.html {<性病>

#.root.   /var/www/nginx-default;.

#}



#. proxy the PHP scripts to Apache listening on 127..0.0.1:80             电子

#location ~ \..php$ {<性病>

#fastcg.i_.pass   127.0.0.1:80;.

#fastcgi_index index.php.;.

#fastcgi_p.aram SCRIPT_.FILENAME /scripts$fastcgi_script_name;域名

#includefastc.gi_params;[成人用品]

#}



# pass the PHP scripts to FastCGI server listenin.g on 127.0..0.1:9000.

locat.ion ~ \.php {           女人

fastcgi_pass   12.7.0.0.1:900.0;.

fastcgi_in.dex index.php;    健康





set $path_in.fo "/";<性病>

set $real_script_name $fas..tcgi_script_name;外贸

if ($fastcgi_sc.ript_name ~ "^(.+?\.ph.p)(/.+)$") {           建材

set $real_script_name $1.;.

s.et $path_info $2;    健康

}

fastcgi_par.am SCRIPT_FILENAME /var/www/xxx.com/$real_sc.ript_name;              乙肝

fastcgi_param S.CRIPT_NAME      $real_script._name;投资

fastcgi._param PATH_INF.O        $path_info;[成人用品]

include                        /etc./nginx/fastcgi_par.ams;教育

}



}
复制代码Ubuntu/9.04 nginx/0.6..3.5学习
它仅缓存了根目录下边的文.件,首页调用的别的目录下边.的图片不缓存学习

高人帮忙看看,急啊
评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个