VPS侦探论坛

 找回密码
 注册
查看: 5402|回复: 3

vhost.sh的问题

[复制链接]
发表于 2011-11-19 13:54:51 | 显示全部楼层 |阅读模式

  1. location / {
  2. try_files \$uri @apache;
  3. }

  4. location @apache {
  5. internal;
  6. proxy_pass http://127.0.0.1:88;
  7. include proxy.conf;
  8. }

  9. location ~ .*\.(php|php5)?$
  10. {
  11. proxy_pass http://127.0.0.1:88;
  12. include proxy.conf;
  13. }


  14. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  15. {
  16. expires 30d;
  17. }

  18. location ~ .*\.(js|css)?$
  19. {
  20. expires 12h;
  21. }
复制代码


这段是不是没有把html交给nginx处理啊?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-11-19 17:13:06 | 显示全部楼层


安装了lnmpa

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

location ~ .*\.(js|css)?$

可以解释下图象文件和JS/CSS文件为什么要分开设置?填加RAR/ZIP等的话要怎么加?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-11-19 21:30:08 | 显示全部楼层

js/css肯定比图片之类的修改频繁

按上面的格式加上一个rar的就行了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-11-21 12:32:14 | 显示全部楼层



还有不是没有把html交给nginx处理啊?
需要添加HTML到location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
吗?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-21 17:50 , Processed in 0.025541 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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