全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 504|回复: 4
打印 上一主题 下一主题

lnmpa是不是nginx已经配置好缓存网站的图片和js等文件?

[复制链接]
跳转到指定楼层
1#
发表于 2013-3-9 19:42:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 jsjfans 于 2013-3-9 19:45 编辑

lnmpa是不是nginx已经配置好静态缓存网站的图片和js等文件?

还是需要设置下?

该如何设置?

谢谢!!
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.abc.com abc.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/www.abc.com;

  7.                 location / {
  8.                         try_files $uri @apache;
  9.                         }

  10.                 location @apache {
  11.                         internal;
  12.                         proxy_pass http://127.0.0.1:88;
  13.                         include proxy.conf;
  14.                         }

  15.                 location ~ .*\.(php|php5)?$
  16.                         {
  17.                                 proxy_pass http://127.0.0.1:88;
  18.                                 include proxy.conf;
  19.                         }

  20.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  21.                         {
  22.                                 expires      30d;
  23.                         }

  24.                 location ~ .*\.(js|css)?$
  25.                         {
  26.                                 expires      12h;
  27.                         }

  28.                 access_log  /home/wwwlogs/www.abc.com.log  www.abc.com;
  29.         }
复制代码
默认是这个配置  
2#
发表于 2013-3-9 19:43:55 | 只看该作者
不懂。。。
3#
发表于 2013-3-9 19:44:17 来自手机 | 只看该作者
没用过
4#
发表于 2013-3-9 19:44:17 | 只看该作者
应该是已经配置好了吧
5#
发表于 2013-3-9 19:57:03 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-17 07:31 , Processed in 0.173633 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表